Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <script src="table-sort.js"></script>
- </head>
- <body>
- <table>
- <thead>
- <tr>
- <th>Col1</th>
- <th>Col2</th>
- <th>Col3</th>
- </tr>
- </thead>
- <tbody id="the-table-body">
- <tr>
- <td>A</td>
- <td>3</td>
- <td>0.5</td>
- </tr>
- <tr>
- <td>B</td>
- <td>5</td>
- <td>1.2</td>
- </tr>
- <tr>
- <td>C</td>
- <td>1</td>
- <td>2.7</td>
- </tr>
- <tr>
- <td>D</td>
- <td>4</td>
- <td>0.9</td>
- </tr>
- <tr>
- <td>E</td>
- <td>2</td>
- <td>5.3</td>
- </tr>
- </tbody>
- </table>
- <button id="sort-button-1">Sort by Column 1</button>
- <button id="sort-button-2">Sort by Column 2</button>
- <button id="sort-button-3">Sort by Column 3</button>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement