<li>Nested tables with sticky headers now stack properly. See the new example added to the bottom of this demo page.</li>
<li>Added <code>stickyHeaders_xScroll</code> and <code>stickyHeaders_yScroll</code> widget options.</li>
<li>Any defined <ahref="index.html#onrenderheader"><code>onRenderHeader</code></a> function is now executed on the cloned sticky header table cells; the <ahref="index.html#onrendertemplate"><code>onRenderTemplate</code></a> function is <em>not</em>! See the change log section for more details.</li>
</ul>
<br>
</li>
<li><spanclass="label label-info">Note</span> To access the added sticky table content from your code without worrying about using the ID, you can use <code>table.config.widgetOptions.$sticky</code>.</li>
<li><spanclass="label label-info">Note</span> Add the class name <code>sticky-false</code> to any header rows you don't want to become sticky (v2.1.18).<p></p></li>
<li>You will need to modify the <code>headerTemplate</code> option to include the jQuery UI icon! See the example in the code (v2.7).</li>
<li>Scroll down the page to see the headers stick. Then sort the columns using the sticky headers!</li>
<li>Multiple rows in the header, including the filter row, will become sticky.</li>
<li><strong>As of tablesorter version 2.9+, this widget can no longer be applied to versions of tablesorter prior to version 2.8</strong>.</li>
<li><strong>Because of the limitations of Internet Explorer version 7 and older, this widget will not work</strong>.</li>
</ul>
</div>
<h3><ahref="#">Options</a></h3>
<div>
<h4>stickyHeaders widget defaults (added inside of tablesorter <code>widgetOptions</code>)</h4>
<div>
<spanclass="label label-info">TIP!</span> Click on the link in the function column to reveal full details (or <ahref="#"class="toggleAll">toggle</a>|<ahref="#"class="showAll">show</a>|<ahref="#"class="hideAll">hide</a> all) or double click to update the browser location.
<td>Include any extra class name to be added to the sticky header table (v2.1; <spanclass="version updated">v2.18.0</span>)
<divclass="collapsible">
<br>
<spanclass="label warning">Note</span> prior to v2.18.0, this class was applied to the sticky table <code>thead</code>; after v2.18.0, the <code>thead</code> and <code>caption</code> are wrapped in a div that is made sticky, with this class name.<br>
<br>
Modified in <spanclass="version">v2.11</span> so that "tablesorter-stickyHeader" class is always added and this option only adds additional classes.
<td>Set this to a number (in pixels) or jquery selector targeting the <code>position:fixed</code> element in which to place the sticky header below while scrolling.</td>
<td>If the original table has an ID, then the value from this option is added to the end of the cloned table to maintain a unique ID (<spanclass="version">v2.9</span>).
<divclass="collapsible">
<ul>
<li>It contains a suffix to add to any table id.</li>
<li>Its default value is <code>-sticky</code></li>
<td>When <code>true</code>, the <ahref="index.html#function-resizeevent"><code>$.tablesorter.addHeaderResizeEvent</code></a> function is applied to the table header cells so a "resize" event is triggered and the sticky headers widget can then properly resize the cloned table header cells to match the originals.</td>
<td>Set this option as a jQuery selector or object where the sticky header will be attached (<spanclass="version">v2.14.4</span>).
<divclass="collapsible">
<ul>
<li>Setting this option with either a jQuery selector string (<code>".wrapper"</code>) or jQuery object (<code>$(".wrapper")</code>).</li>
<li>This option contains the target to which the sticky header will attach - see the <ahref="#table2">second example</a> below.</li>
<td>Scroll table top into view after filtering (<spanclass="version updated">v2.16.2</span>)
<divclass="collapsible">
<br>
This is needed when the user choses to filter the table which results in fewer rows than are currently visible in the browser viewport. So, the sticky header may still exist, but the table body may not be seen. Setting this option to <code>true</code> forces the original table header to scroll back into view.
<td>jQuery selector or object that will be used to monitor horizontal scroll position(<spanclass="version">v2.18.0</span>)
<divclass="collapsible">
<br>
Defaults: xScroll > attachTo > window<br>
<br>
Indicate the element (jQuery selector or obect) in which to monitor for changes in scroll position; If undefined (<code>null</code> by default), the window is monitored.
<td>jQuery selector or object that will be used to monitor vertical scroll position (<spanclass="version">v2.18.0</span>)
<divclass="collapsible">
<br>
Defaults: yScroll > attachTo > window<br>
<br>
Indicate the element (jQuery selector or obect) in which to monitor for changes in scroll position; If undefined (<code>null</code> by default), the window is monitored.
</div>
</td>
</tr>
</tbody>
</table>
</div>
<h3><ahref="#">Change log</a></h3>
<div>
<ul>
<li><spanclass="version">v2.18.0</span>:
<ul>
<li>Nested tables with sticky headers now stack properly. See the new example added to the bottom of this demo page.</li>
<li>Added <code>stickyHeaders_xScroll</code> and <code>stickyHeaders_yScroll</code> options to indicate the element (jQuery selector or obect) in which to monitor for changes in scroll position; If undefined (<code>null</code> by default), the window is monitored.</li>
<li>Any defined <ahref="index.html#onrenderheader"><code>onRenderHeader</code></a> function is now executed on the cloned sticky header table cells. There are now 3 parameters available to this function:
<ul>
<li><code>index</code> - header cell index; this is <em>not</em> the column index!</li>
<li><code>config</code> - the <code>table.config</code> settings for the table.</li>
<li><code>$table</code> - the target of this parameter changes:
<ul>
<li>For the original table header cells, this parameter is a jQuery object pointing to the original table; this table has the class name <code>hasStickyHeaders</code>.</li>
<li>When the sticky table header cells are processed, this parameter is a jQuery object pointing to a copy of the table that is used as a sticky header; this table has the class name <code>containsStickyHeaders</code>.</li>
</ul>
</li>
</ul>
<spanclass="label label-info">Note</span> Any defined <ahref="index.html#onrendertemplate"><code>onRenderTemplate</code></a> function is <em>not</em> called on the sticky header because it is a clone of the already rendered header cell; instead use <code>onRenderHeader</code> to attach event listeners, etc.
</li>
<li>Removed jQuery UI theme from the theme selector in this demo to accomodate adding the accordion. With the current setup, changing the table theme would continue to show the jQuery UI class names on the table (uitheme is not removed when switching themes), so the tables became a chimera of jQuery UI and the selected theme, and the accordion would become un-styled; it was a real mess.<br>
<br>
</li>
</ul>
</li>
<li><spanclass="version">v2.14.4</span>: Added <code>cssStickyHeaders_attachTo</code> option (default set to <code>null</code>).
<ul>
<li>Setting this option with either a jQuery selector string (<code>".wrapper"</code>) or jQuery object (<code>$(".wrapper")</code>).</li>
<li>This option contains the target to which the sticky header will attach - see the <ahref="#table2">second example</a> below.</li>
</ul>
</li>
<li>v2.9:
<ul>
<li><strong>As of tablesorter version 2.9+, this widget can no longer be applied to versions of tablesorter prior to version 2.8</strong>.</li>
<li>Added a widget option named <code>stickyHeaders_cloneId</code>
<ul>
<li>It contains a suffix to add to any table id.</li>
<li>Its default value is <code>-sticky</code></li>
</ul>
</li>
<li>Table captions and any additional rows (filter widget row) will also be included in the sticky header.</li>
</ul>
</li>
<li>v2.7: You will need to modify the <code>headerTemplate</code> option to include the jQuery UI icon! See the example in the code.</li>
<li>v2.1.18: Add the class name <code>sticky-false</code> to any header rows you don't want to become sticky.</li>
<li>v2.1.17: Multiple rows in the header will become sticky.</li>
<li>v2.1 (updated v2.11): Added a widget option named <code>stickyHeaders</code> option which contains the css class name applied to the actual sticky header. Modified in <spanclass="version">v2.11</span> so that "tablesorter-stickyHeader" class is always added and this option only adds additional classes.</li>