tablesort

Select and sort a column in a table using Javascript

情到浓时终转凉″ 提交于 2021-02-19 05:40:06
问题 I want to select a particular column of a table and sort it accordingly using Javascript (No frameworks or plugins). Could anyone help me regarding this? <table> <thead> <tr> <td>Col1</td> <td>Col2</td> <td>Col3</td> <td>Col4</td> </tr> </thead> <tbody> <tr> <td>Data11</td> <td>Data23</td> <td>Data53</td> <td>Data45</td> </tr> <tr> <td>Data81</td> <td>Data42</td> <td>Data33</td> <td>Data4854</td> </tr> <tr> <td>Data84681</td> <td>Data452</td> <td>Data354</td> <td>Data448</td> </tr> <tr> <td

HTML表格自动排序

[亡魂溺海] 提交于 2020-12-08 21:55:05
jquery-tablesort jquery-tablesort下载地址 <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>table sort</title> <style type="text/css"> * { margin: 0; padding: 0; } body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; color: #4f6b72; background: #E6EAE9; } #container { display: flex; align-items: center; justify-content: center; width: 100vw; margin: 0 auto; } table { width: 90%; max-width: 500px; font-size: 18px; text-align: center; margin-top: 50px; } th { color: white; font-size: 20px; border-right: 1px solid #C1DAD7; border-bottom: 1px solid #C1DAD7; border-top: 1px