【发布时间】:2013-07-21 11:11:27
【问题描述】:
我知道有很多关于隐藏列的帖子,但我会添加另一个问题。下面是一个来自 php 生成的 html 的 sn-p:
<table id="dataGrid">
<col style="display:none">
<col style="display:table-column">
<col style="display:table-column">
<col style="display:table-column">
<col style="display:table-column">
<col style="display:table-column">
<col style="display:table-column">
<col style="display:table-column">
<thead><tr>
...
这根本不起作用。有没有一种有效的方法来通过 html/css 隐藏列,而不使用无数的 td? w3.org 暗示有,但我尝试了可见性、隐藏、折叠表格单元格等 - 没有结果。
我不想在巨大的表中为每个设置一个类,所以 jquery 是不可能的。
【问题讨论】:
-
向我们展示您的 CSS 以及您尝试过的内容
-
请参阅w3schools.com/TAGS/tag_col.asp
display不是受支持的属性。 -
@DevZer0 - 嗯嗯。 w3fools 提到
<col>标签支持 align、char、charoff、span、valign 和 width 属性。 然而对于它会响应哪些style属性没有什么可说的。也许您将<col style="display误读为<col display?
标签: php html css html-table