id summary reporter owner description type status priority component severity resolution keywords cc release 12850 I have found a way to make TableSorterPlugin work with standard wiki tables, by adding some additional wiki formatting and javascript around them (dynamic) chad.trytten@… Peter Suter "= How to Create a SortableTable = A SortableTable (-enabled standard wiki table) depends on having installed the [https://trac-hacks.org/wiki/TableSorterPlugin TableSorterPlugin] and having [https://trac.edgewall.org/wiki/TracIni#wiki-section enabled JavaScript for Trac] by enabling {{{render_unsafe_content}}}. 1. Create a standard wiki table. * For example: {{{ ||= '''One''' =||= '''Two''' =|| || Three || Four || || Five || Six || }}} 1. Paste additional formatting text above the standard wiki table, replacing the table """" with the current count number. * For example * NOTE: there would be no {{{ } } } }}} below the {{{ || ********** ||}}} in the text you paste - it shows up on this page due to formatting limitations: {{{ {{{#!table id=""table"" class=""tablesorter"" || ********** || }}} }}} would look like this when added above the standard table and set to 1 (your first table, followed by 2, 3, etc.): {{{ {{{#!table id=""table1"" class=""tablesorter"" || ********** || ||= '''One''' =||= '''Two''' =|| || Three || Four || || Five || Six || || ********** || }}} }}} 1. Lastly, paste additional script text below the standard wiki table: * For example: * NOTE: there would be no {{{ { { {}}} above the {{{ || ********** ||}}} in the text you paste - it shows up on this page due to formatting limitations: {{{ {{{ || ********** || }}} {{{ #!html }}} // }}} would look like this when added above the standard wiki table and set to 1 (your first table, followed by 2, 3, etc.): {{{ {{{#!table id=""table1"" class=""tablesorter"" || ********** || ||= '''One''' =||= '''Two''' =|| || Three || Four || || Five || Six || || ********** || }}} {{{ #!html }}} // }}} * The final {{{ // }}} is to allow for normal editing by the WYSIWYG editor - otherwise, it messed up spacing. 1. Lastly, edit the table however you'd like! You can use the textarea or WYSIWYG editor. The only text you need to edit (except the replaced during setup) is in between the {{{ || ********** ||}}} lines - the code will dynamically do the the rest for you. 1. WARNING: Don't remove the {{{ || ********** ||}}} lines - they are programmatically removed by the code when the page loads, and are left there for easy markers to know that you ONLY need to edit in between them! * NOTE: The first time you finish editing the page, the table might look odd until you refresh the page as some browsers don't like loading Javascript after trac exits edit mode, for some reason... this behavior only shows up after editing and never while viewing! IMPROVEMENT: Could dynamically grab all tables that have class ""table sorter"" but currently too lazy to do the checks in javascript from the DOM. This would mean that you'd only need to add the javascript code on the page once - eat the bottom, after the standard wiki tables have been added to the DOM - but keeping the code close to each actual table text input is also useful for understanding how it works, so left as is." enhancement closed normal TableSorterPlugin normal fixed