This widget will only work in tablesorter version 2.8+ and jQuery version 1.7+.
The required css, shown below, is needed to make this widget work, but is completely customizable.
This demo sets the reflow breakpoint to 35em; so you'll need to resize your browser window to see this widget in action.
This widget is compatible with the column selector widget; but please note:
When a column is hidden, it will not show up when the table reflow occurs
For an example, see the second demo "Reflow + columnSelector widget" below.
The column selector widget, by default, has an additional breakpoint at "30em". So if the column selector is set to "Auto" and you continue to reduce the browser width after the table reflows, you'll see "Geometry" row disappear.
It may not have been necessary to create two versions of this widget, but it was done because:
The first "reflow" widget does not add additional content to the tbody table cells, but it did not work well when attempting to add multiple content rows within the data-attribute. It would work if the css explicitly has the content set with a break like this (ref):
content:"row1 \A row2";
But sadly, this method does not work when a data-attribute with the same content is used:
content: attr(data-title);
The second method ignores the backslash and shows "row1 \A row2"
Update: After some discussion in bugzilla, I discovered that it is possible to add multiple lines of content usigin a data-attribute by setting a white-space: pre; css definition and using 
 instead of \A (demo), but I think I'll keep the second reflow version because it actually allows styling.
Adding bold elements to every table tbody cell is the method used by jQuery Mobile; so, a second reflow widget "reflow2" was created to do the same, and work properly with a thead containing multiple rows.
If you do not want the sortable headers to show when the table reflows, include this css within the media query:
Set this option to use your desired data-attribute. The set data-attribute contains the alternative header title added to every table body cell when the table reflows.
For example, the "Sex" column below is renamed to "Gender" within the reflow cells:
<thdata-name="Gender">Sex</th>
Default value: "data-name"
reflow_dataAttrib
Set this option to use your desired data-attribute which is added to every table body cell. It will contain the header name which is shown once the table reflows.
For example, all of table body cells will show the contents from the set data-attribute when the table reflows:
Set this option to use your desired data-attribute. The set data-attribute contains the alternative header title added to every table body cell when the table reflows.
For example, the "Sex" column below is renamed to "Gender" within the reflow cells:
<thdata-name="Gender">Sex</th>
Default value: "data-name"
reflow2_labelClass
Set this option to use your desired class name.
When the table reflows, the bold element (<b>) with this class name will be revealed; it must also be defined within the media query to display this element as an "inline-block", so it shares the row with the cell content
When the table reflows, the all upper header cell content is also included in every corresponding column table cell within a bold element (<b>); it must also be defined within the media query to display this element as a "block"
The reflow widgets require the following css to hide/show header cell content within each table cell. Remove the css for whichever reflow widget that is not being used, as desired.
/* REQUIRED CSS: change your reflow breakpoint here (35em below) */ @media( max-width:35em){
/* uncomment out the line below if you don't want the sortable headers to show */ /* table.ui-table-reflow thead { display: none; } */
/* css for reflow & reflow2 widgets */ .ui-table-reflow td, .ui-table-reflow th { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; float: right; /* if not using the stickyHeaders widget (not the css3 version) * the "!important" flag, and "height: auto" can be removed */ width:100%!important; height:auto!important; }
<h3>Reflow columnSelector widget</h3> <!-- This selector markup is completely customizable --> <divclass="columnSelectorWrapper"> <inputid="colSelect1"type="checkbox"class="hidden"> <labelclass="columnSelectorButton"for="colSelect1">Column</label> <divid="columnSelector"class="columnSelector"> <!-- this div is where the column selector is added --> </div> </div> (When "Auto" is set, the table becomes responsive; resize the browser window to see it work)
// simple reflow widget (table with 1 header row) $("#table1").tablesorter({ theme:'blue', widgets:['zebra','reflow'], widgetOptions :{ // class name added to make it responsive (class name within media query) reflow_className :'ui-table-reflow', // header attribute containing modified header name reflow_headerAttrib :'data-name', // data attribute added to each tbody cell // it contains the header cell text, visible upon reflow reflow_dataAttrib :'data-title' } });
// simple reflow widget + columnSelector & stickyHeaders widgets $("#table2").tablesorter({ theme:'blue', widgets:['zebra','reflow','columnSelector','stickyHeaders'], widgetOptions :{ // target the column selector markup columnSelector_container : $('#columnSelector'), // data attribute containing column name to use in the selector container // make it use the same as reflow_headerAttrib columnSelector_name :'data-name',
// reflow2 widget (table with multiple header rows) $("#table3").tablesorter({ theme:'blue', widgets:['zebra','reflow2'], widgetOptions:{ // class name added to make it responsive (class name within media query) reflow2_className :'ui-table-reflow', // ignore header cell content with this class name reflow2_classIgnore :'ui-table-reflow-ignore', // header attribute containing modified header name reflow2_headerAttrib :'data-name', // class name applied to thead labels reflow2_labelClass :'ui-table-cell-label', // class name applied to first row thead label reflow2_labelTop :'ui-table-cell-label-top' } });