跨越表格宽度的表格页脚自动跨越 [英] Table footer auto spanning across width of table
问题描述
根据我收到的数据,我有一个有动态栏数的表格。
我有一个标签,它需要遍布所有列,而与表中的列数无关。
I have a table which has dynamic number of columns depending on data I receive. I have a tag which needs to spread across all columns independent of number of columns in a table.
<table>
<thead>
<tr>
<th><span>ColA</span></th>
<th><span>ColB</span></th>
<th rowspan='2'><span>Col<br/> C</span></th>
</tr>
</thead>
<tbody>
</tbody>
<tfoot>
<tr>
<td>Footer content here</td>
</tr>
</tfoot>
</table>
编辑
colspan = 0为我工作!
EDIT colspan = 0 worked for me!
<td colspan='0'>Footer content here</td>
适用于FF,不适用于Chrome,IE8:(
Works on FF, Did not work for Chrome, IE8 though :(
编辑2
colspan ='100%'
此链接解决了crossbrowser问题
https://stackoverflow.com/a/5028091/405117
colspan = '100%' This link solved crossbrowser problem https://stackoverflow.com/a/5028091/405117
推荐答案
使用 colspan =0
顺便说一句,您的< tfoot>
应位于< thead>
和< tbody>
标签之间。
Use colspan="0"
By the way, your <tfoot>
should be between <thead>
and <tbody>
tags.
编辑:被W3C推荐的做法不是跨浏览器的,仔细使用!
That practice, being recommended by W3C, is not cross-browser. Use carefully!
这篇关于跨越表格宽度的表格页脚自动跨越的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!