Changes between Version 15 and Version 16 of TableSorterPlugin


Ignore:
Timestamp:
Mar 23, 2017, 11:18:17 PM (7 years ago)
Author:
Peter Suter
Comment:

Document new (r16371) approach where it works automatically for standard wiki tables

Legend:

Unmodified
Added
Removed
Modified
  • TableSorterPlugin

    v15 v16  
    55== Description
    66
    7 This plugin allows you to sort tables on your Trac wiki or ticket pages. It uses the [http://tablesorter.com/ tablesorter jQuery plugin] for turning HTML tables into a sortable table without requiring a page refresh. The HTML-code of the table must be specified with the THEAD and TBODY tags for this to work.
     7This plugin allows you to sort tables on your Trac wiki or ticket pages. It uses the [http://tablesorter.com/ tablesorter jQuery plugin] for making wiki tables sortable.
    88
    99This plugin is a wrapper around the third-party Javascript library `jquery.tablesorter`, that is dual licensed under the MIT and GPL licenses.
     
    3333== Example
    3434
    35 A screenshot with a table with sortable headings would look as follows:
     35This is standard [WikiFormatting#Tables table wiki formatting]:
     36{{{
     37||= Last Name =||= First Name =||= Email =||= Due =||
     38|| Smith || John || jsmith@gmail.com || $50.00 ||
     39|| Bach || Frank || fbach@yahoo.com || $50.00 ||
     40|| Doe || Jason || jdoe@hotmail.com || $100.00 ||
     41|| Conway || Tim || tconway@earthlink.net || $50.00 ||
     42}}}
    3643
     44Without this plugin it would be shown like this:
     45||= Last Name =||= First Name =||= Email =||= Due =||
     46|| Smith || John || jsmith@gmail.com || $50.00 ||
     47|| Bach || Frank || fbach@yahoo.com || $50.00 ||
     48|| Doe || Jason || jdoe@hotmail.com || $100.00 ||
     49|| Conway || Tim || tconway@earthlink.net || $50.00 ||
     50
     51With this plugin the table is sortable by clicking the headings:
    3752[[Image(tableSorterPlugin-screenshot.2.png,border=2)]]
    38 
    39 The tablesorter plugin requires a `THEAD` tag, which is not added to [trac:wiki:WikiFormatting#Tables normal wiki tables], so use [trac:wiki:WikiHtml WikiHtml] instead. The class `tablesorter` is also required:
    40 
    41 {{{
    42 {{{#!html
    43 <table id="myTable" class="tablesorter">
    44 <thead>
    45 <tr>
    46     <th>Last Name</th>
    47     <th>First Name</th>
    48     <th>Email</th>
    49     <th>Due</th>
    50 </tr>
    51 </thead>
    52 <tbody>
    53 <tr>
    54     <td>Smith</td>
    55     <td>John</td>
    56     <td>jsmith@gmail.com</td>
    57     <td>$50.00</td>
    58 </tr>
    59 <tr>
    60     <td>Bach</td>
    61     <td>Frank</td>
    62     <td>fbach@yahoo.com</td>
    63     <td>$50.00</td>
    64 </tr>
    65 <tr>
    66     <td>Doe</td>
    67     <td>Jason</td>
    68     <td>jdoe@hotmail.com</td>
    69     <td>$100.00</td>
    70 </tr>
    71 <tr>
    72     <td>Conway</td>
    73     <td>Tim</td>
    74     <td>tconway@earthlink.net</td>
    75     <td>$50.00</td>
    76 </tr>
    77 </tbody>
    78 </table>
    79 }}}
    80 }}}
    8153
    8254== Recent Changes