FixedColumns example Left and right fixed columns

FixedColumns allows columns to be fixed from both the left and right hand sides of the table. Fixing right hand-side columns is done by using the rightColumns initialisation parameter, which works just the same as leftColumns does for the left side of the table. This example shows both the left and right columns being fixed in place.

The Javascript shown below is used to initialise the table shown in this example:

1
2
3
4
5
6
7
8
9
10
11
12
13
$(document).ready(function() {
    var table = $('#example').DataTable( {
        scrollY:        "300px",
        scrollX:        true,
        scrollCollapse: true,
        paging:         false
    } );
 
    new $.fn.dataTable.FixedColumns( table, {
        leftColumns: 1,
        rightColumns: 1
    } );
} );

In addition to the above code, the following Javascript library files are loaded for use in this example: