This page contains several tables used to demonstrate proposed colspan/rowspan enhancements to Wikipedia table sorting functions. To view the enhancements in operation, you must add importScript('User:Tcncv/sorttables.js'); to your monobook.js file (or appropriate xxx.js file for your chosen skin).
In addition to these tables, you can try the functionality on your own tables (on a suitable test page - not mainspace) by adding class="wikitable tsx_sortable" to the table header. The class="autorowspan" attribute can also be added to columns or the entire table to maximize cell merge operations.
Note that the Rank column has a number of merged cells, but when the table is sorted, they are split, so that the table layout is not corrupted. If you sort by Rank again, previously merged cells are recombined. Also, if you sort a number of adjacent columns right to left (uch as Bronze, Silver, then Gold), cells are merged in all these columns. (That may not be desirable in all cases, but for this example, its been enabled.)
Test procedure
Click sort icon in total column and observe results.
Column sorts correctly ascending or descending
Header and footer rows remain in place
Repeated values are merged (due to use of table-wide autorowspan option).
Click same sort icon and note that sort order reverses.
Click sort icon in Silver column.
Review table sort and cell merge in that column.
Observe that cells in total column are no longer merged.
Click sort icon in Gold column.
Review table sort and cell merge.
The adjacent Silver column also has some merged cells.
(Note: It is normal if adjacent columns are sorted in opposite orders. This is dependent on the overall sequence of sort operations selected by the user.)
Click sort icon in Gold column again.
Gold column sort order reverses.
The adjacent Silver column still has some merged cells.
Now click the sort icons in Total, Bronze, Silver, and Gold columns in succession once or twice each to achieve descending sort order.
All four columns have merges cells.
Cells in the Silver, Bronze, and Total columns are merged only if the corresponding cells to their left are also merged.
Click the sort icon in the Rank column.
Rank column is sorted and matching cells are merged.
Cells in the Gold, Silver, Bronze, and Total column are no longer merged.
Note that the Rank column has a number of merged cells, but when the table is sorted, they are split, so that the table layout is not corrupted. If you sort by Rank again, previously merged cells are recombined. Also, if you sort a number of adjacent columns right to left (uch as Bronze, Silver, then Gold), cells are merged in all these columns. (That may not be desirable in all cases, but for this example, its been enabled.)
Overlapping row spans and column spans are invalid in HTML and are not supported by the updated sortable script. These examples are included just to see how they render.
Demonstrates multi-row headers with rowspans and fixed (unsortable) footer.
Click [Show] to view example-->
Indicates a state or territory that has not yet held a caucus or primary or whose polling data has not been made available. All data is based on recent surveys.
Indicates a state or territory that has held a caucus, primary, or convention.
Demonstrates multi-row headers with rowspans and colspans. Sort icons are suppressed on some header cells. Also changed "sortbottom" to "unsortable" to stablize the footer rows.
^Selective Download filters can skip/delete messages on POP3 server based on header (sender, recipient, subject, etc) information, this doesn't require to retrieve the full message body from the server.
^Message Dispatcher allows the user to decide which messages should be retrieved, deleted or skipped based on the header information (sender, recipient, subject, etc) displayed to the user.
The following data is not real, it has been adapted/fabricated to test assorted complex rowspan/colspan combinations. Note that the data in the first set of columns matches the data in the second set.