【发布时间】:2014-08-30 16:44:42
【问题描述】:
我希望能够取一张 HTML 表格,比如here:
<table border="1">
<tbody>
<thead>
<tr>
<th></th>
<th><a href="http://translate.com" target="_blank">translate.com & https://translate.google.com</a></th>
<th><a href="http://www.bing.com/translator/" target="_blank">Bing Translator</a></th>
<th></th>
</tr>
</thead>
<tr>
<td>I eat tacos</td>
<td>Yo como tacos</td>
<td>Comer tacos</td>
</tr>
<tr>
<td>I will eat a taco</td>
<td>Voy a comer un taco</td>
<td>Me voy a comer un taco</td>
</tr>
<tr>
<td>I will eat tacos</td>
<td>Voy a comer tacos</td>
<td>Me voy a comer tacos</td>
</tr>
<tr>
<td>I would eat a taco</td>
<td>Me volvería a comer un taco</td>
<td>Comer un taco</td>
</tr>
<tr>
<td>I would eat tacos</td>
<td>Me volvería a comer tacos</td>
<td>Comer tacos</td>
</tr>
<tr>
<td>I am eating a taco</td>
<td>Me estoy comiendo un taco</td>
<td>Estoy comiendo un taco</td>
</tr>
<tr>
<td>I am eating tacos</td>
<td>Estoy comiendo tacos</td>
<td>Voy a comer tacos</td>
</tr>
. . .
<tr>
<td>They were eating tacos</td>
<td>Estaban comiendo tacos</td>
<td>Estaban comiendo tacos</td>
</tr>
</tbody>
</table>
(或任何 HTML 表格)并允许在单击列时对其进行排序。
jQuery 或 CSS 解决方案都可以。
【问题讨论】:
-
使用 jquery 数据表插件
-
你不会得到一个 css 解决方案,你最好只是在谷歌上搜索像 DataTables 这样的东西 - 那里有大量的 javascript 表格库。
标签: jquery css html-table