如何在mvc 4中对html表进行排序 [英] how to sort html table in mvc 4

查看:62
本文介绍了如何在mvc 4中对html表进行排序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在标题点击中对表格进行排序,但除了tbody中的第一个。





我的桌子是

 <   table  >  
< thead >
< tr >
< th >
图标
< / th >
< th >
姓名
< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td > ;
< / td >
< td >
< input type = text 占位符 = 搜索 / >
< / td >
< / tr >
< tr > //只想排序这个tr,数据是来自数据库
< td > @item.Icon< / td > ;
< td > @ item.Name < / td >
< / tr >
< / tbody >
< / table >

解决方案

这里你有jquery库来按标题排序html表。

I want to sort table tbody on header click but except first in tbody.


My table is

<table>
    <thead>
        <tr>
            <th>
                Icon
            </th>
            <th>
                 Name
            </th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>
            </td>
            <td>
                <input type="text" placeholder="search"/>
            </td>
        </tr>
        <tr>     //want sort only this tr, data is from database
            <td>@item.Icon</td>
            <td>@item.Name</td>
        </tr>
    </tbody>
</table>

解决方案

Here you have jquery library to sort the html table by their headers.


这篇关于如何在mvc 4中对html表进行排序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆