Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The following is a way to achieve a fixed header table, I don't know if it will be enough for your purpose. Changes are:</p> <ol> <li>use "bScrollCollapse" instead of "sScrollXInner"</li> <li>don't use fieldset to wrap table </li> <li>add a "div.box" css class</li> </ol> <p>It seems fully working on my local machine, but it's not fully working using Fiddle. It seems that Fiddle adds a css file (normalize.css) that in some way broke the plugin css (quite sure I can make fully working also in Fiddle adding some css clear rules, but not have time to investigate further now)</p> <p>My working code snippet is below. Hope this can help.</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;meta http-equiv="content-type" content="text/html; charset=UTF-8"&gt; &lt;script type='text/javascript' src='http://code.jquery.com/jquery-1.8.2.js'&gt;&lt;/script&gt; &lt;script type='text/javascript' src="http://datatables.net/release-datatables/media/js/jquery.dataTables.min.js"&gt;&lt;/script&gt; &lt;style type='text/css'&gt; div.box { height: 100px; padding: 10px; overflow: auto; border: 1px solid #8080FF; background-color: #E5E5FF; } .standard-grid1, .standard-grid1 td, .standard-grid1 th { border: solid black thin; } &lt;/style&gt; &lt;script type='text/javascript'&gt; $(window).load(function(){ $(document).ready(function() { var stdTable1 = $(".standard-grid1").dataTable({ "iDisplayLength": -1, "bPaginate": true, "iCookieDuration": 60, "bStateSave": false, "bAutoWidth": false, //true "bScrollAutoCss": true, "bProcessing": true, "bRetrieve": true, "bJQueryUI": true, "sDom": '&lt;"H"CTrf&gt;t&lt;"F"lip&gt;', "aLengthMenu": [[25, 50, 100, -1], [25, 50, 100, "All"]], "sScrollX": "100%", //"sScrollXInner": "110%", "bScrollCollapse": true, "fnInitComplete": function() { this.css("visibility", "visible"); } }); }); }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div&gt; &lt;table class="standard-grid1 full-width content-scrollable" id="PeopleIndexTable"&gt; &lt;thead&gt; &lt;!-- put your table header HTML here --&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;!-- put your table body HTML here --&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload