mirror of
https://github.com/DataTables/DataTables.git
synced 2025-02-28 01:54:15 +01:00
30 lines
1.2 KiB
XML
30 lines
1.2 KiB
XML
<?xml version="1.0" encoding="UTF-8" ?>
|
|
<dt-example table-type="html">
|
|
|
|
<css lib="datatables" />
|
|
<js lib="jquery" />
|
|
<js lib="datatables" />
|
|
|
|
<title>Scroll - vertical</title>
|
|
<js><![CDATA[
|
|
$(document).ready(function() {
|
|
$('#example').dataTable( {
|
|
"scrollY": "200px",
|
|
"scrollCollapse": true,
|
|
"paginate": false
|
|
} );
|
|
} );
|
|
]]></js>
|
|
|
|
<info><![CDATA[
|
|
|
|
This example shows the DataTables table body scrolling in the vertical direction. This can generally be seen as an alternative method to pagination for displaying a large table in a fairly small vertical area, and as such pagination has been disabled here (note that this is not mandatory, it will work just fine with pagination enabled as well!).
|
|
|
|
To enable y-scrolling simply set the `dt-init scrollY` parameter to be whatever you want the container wrapper's height to be (any CSS measurement is acceptable, or just a number which is treated as pixels).
|
|
|
|
Note also that the `dt-init scrollCollapse` option is enabled in this example. This will have the container match the height of the rows shown in the table if that height is smaller than the given height by the `dt-init scrollY`.
|
|
|
|
]]></info>
|
|
|
|
</dt-example>
|