4

I have been working with Jquery datatables. The open source is very strong and helpful for developers.

My situation is that how to fix the first column and the first header rows of datatables

I've just been searching in http://legacy.datatables.net/extras/fixedcolumns/ and already found the sample I need, however I don't know how to plug it into the HTML datatables opensource projects which contains in the link below

http://datatables.net/download/packages

Anyone who know the integration, please support me.

1 Answer 1

3

SOLUTION

You're looking at the example of old version of jQuery DataTables. The URL for new FixedColumns extension is http://datatables.net/extensions/fixedcolumns/.

Use Download Builder and select jQuery, FixedColumns and FixedHeader in addition to already selected elements.

Use the following code to initialize the table:

var table = $('#example').DataTable({
   scrollY: 300,
   scrollX: true,
   scrollCollapse: true,
   paging: false,        
   fixedColumns: true,
   fixedHeader: true
});

DEMO

See this jsFiddle for code and demonstration.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.