index.html (2685B)
- <!DOCTYPE html>
- <html lang=en>
- <head>
- <meta charset="utf-8"/>
- <title>SortTable — Web demos</title>
- <link rel="stylesheet" href="../common.css"/>
- <link rel="stylesheet" href="sorttable.css"/>
- <script defer="" src="sorttable.js"></script>
- </head>
- <body>
- <!-- http://knowyourmeme.com/memes/born-to-die-world-is-a-fuck-kill-em-all-1989-i-am-trash-man-410757864530-dead-cops -->
- <header title="I hope there is not actually that much dead code online…">
- <pre><strong>BORN TO DIE()</strong>
- WORLD IS A `FSCK`
- 鬼神 Kill Em All 1989
- I am trash main()
- 410,757,864,530 DEAD CODES</pre>
- </header>
- <nav><a rel="up" href="..">Demos Homepage</a></nav>
- <main>
- <h1>SortTable</h1>
- <h2>Sources</h2>
- <ul>
- <li><a href="sorttable.js">sorttable.js</a> (3397B, 1412B gzip’ed)</li>
- <li><a href="sorttable.css">sorttable.css</a> (468B)</li>
- </ul>
- <h2>Usage</h2>
- <ol>
- <li>Add <code><link rel="stylesheet" href="sorttable.css"/></code> and <code><script defer="" src="sorttable.js"></script></code> to the <code>head</code> of your <abbr title="HyperText Markup Language">HTML</abbr> pages</li>
- <li>Tag the <code>table</code>s that you want to be sorted with a <code>class="sortable"</code></li>
- </ol>
- <p>To override a cell(<code>td</code>) value ou can pass the well used <code>data-value</code> attribute to it. Also please note that the sorting may not be <a href="https://en.wikipedia.org/wiki/Sorting_algorithm#Stability">stable</a>.</p>
- <h2>Demo</h2>
- <table class="sortable">
- <thead>
- <tr><th>Date</th><th>Name</th><th>Value</th></tr>
- </thead>
- <tbody>
- <tr><td>1958-10-22</td><td>Anime</td><td>9000</td></tr>
- <tr><td>-8000</td><td>life</td><td data-value="0042">42</td></tr>
- <tr><td>1970-01-01</td><td>Geek</td><td>1337</td></tr>
- </tbody>
- <tfoot>
- <tr><th></th><th></th><th>Total: Too much!</th></tr>
- </tfoot>
- </table>
- <table class="sortable">
- <thead>
- <tr><th class="sorttable_sorted">File</th><th>Size</th><th>Size gzip’ed</th></tr>
- </thead>
- <tbody>
- <tr><td><a href="sorttable.min.js">sorttable.min.js</a></td><td>1491</td><td data-value="0613">613</td></tr
- <tr><td><a href="sorttable.js">sorttable.js</a></td><td>3397</td><td>1412</td></tr>
- <tr><td><a href="sorttable.css">sorttable.css</a></td><td data-value="0468">468</td><td data-value="0170">170</td></tr>
- </tbody>
- </table>
- </main>
- <footer>Copyright 2018-2020 Haelwenn (lanodan) Monnier. Distributed under the <a href="http://creativecommons.org/licenses/by/4.0/">CC-BY 4.0 License</a>. Obviously, this demoset agrees that <a href="http://simpleweb.iscute.ovh/">simple web is cute</a>.</footer>
- </body>
- <html>