【发布时间】:2014-11-17 17:36:48
【问题描述】:
查看this 文章,我做了一个类(t1),以便表格在移动设备上正确定位。像这样:
/*
Label the data
*/
.t1 td:nth-of-type(1):before { content: "Name"; }
.t1 td:nth-of-type(2):before { content: "Category A"; }
.t1 td:nth-of-type(3):before { content: "Category B"; }
.t1 td:nth-of-type(4):before { content: "Category C"; }
.t2 td:nth-of-type(1):before { content: "Name"; }
.t2 td:nth-of-type(2):before { content: "Category X"; }
.t2 td:nth-of-type(3):before { content: "Category Y"; }
.t2 td:nth-of-type(4):before { content: "Category Z"; }
我还从this 网站添加了一个表格分类器,该分类器也工作正常。排序器已经有一个类(tablesorter)
当我使用以下内容时,由于 t1 类
,表格在移动设备上的位置正确<table id="table1" class="t1" width="100%" border="1" >
当我使用以下内容时,由于 tablesorter 类
,表格正在排序<table id="table1" class="tablesorter" width="100%" border="1" >
现在我的问题是我只能在表格中使用一个类,以便移动定位正确发生或分拣机发生。我希望两者都能发挥作用。是否可以在表中使用两个类?我读了一篇文章here,但我认为它不适用于我的问题。任何人都可以提出一种实现这一目标的方法吗?
t2 类工作正常,因为我还没有在上面放置分类器。
谢谢
编辑:它不是重复的,因为我看到一些为多个类编写的函数here 所以很困惑。然而,我现在得到了解决方案,添加了一条评论“当在移动设备上逐行查看表格时,排序功能不起作用。但它在桌面上工作!有没有办法让它在移动设备上工作? "
【问题讨论】:
-
身份定义一次,类创建多次,用空格隔开
标签: css class html-table tablesorter