Html 删除css中的表格thead
我在javascript中使用Markdown/pagedown extra生成一个表,使用:Html 删除css中的表格thead,html,css,Html,Css,我在javascript中使用Markdown/pagedown extra生成一个表,使用: col1|col2 ---|--- xxx|xxx xxx|xxx xxx|xxx Markdown.Extra.init(converter, {table_class: "mytable"}); 这将生成html: <table class='mytable'> <thead> <tr> <th>col1</th> <t
col1|col2
---|---
xxx|xxx
xxx|xxx
xxx|xxx
Markdown.Extra.init(converter, {table_class: "mytable"});
这将生成html:
<table class='mytable'>
<thead>
<tr>
<th>col1</th>
<th>col2</th>
</tr>
</thead>
<tbody><tr>
<td>xxx</td>
<td>xxx</td>
</tr>
<tr>
<td>xxx</td>
<td>xxx</td>
</tr>
<tr>
<td>xxx</td>
<td>xxx</td>
</tr>
</tbody>
</table>
它看起来像:
使用jquery,我可以删除特定页面上所有表的thead:
for (i=0; i < $('table').length; i++) {
$('table')[i].deleteTHead();
}
但我看到一个轻微的闪烁,并看到标题被删除
问题:
还有别的办法吗?可以使用CSS完全删除/隐藏标题吗?以CSS最简单的形式显示:无
为什么不这样做呢:
thead, th {display: none;}
原因是,可见性:隐藏;仍将显示元素所占用的空间。CSS基础:可见性:隐藏保留元素在可见时所占用的空间,而“显示:无”会将其从显示中完全移除。
th{
display:none;
}
thead, th {display: none;}