html tbody的用法介绍

相信很多人都听过html tbody标签,但是对于它的含义及用法却是不了解的,那么我们现在就跟随爱站小编去看看html tbody的用法介绍,感兴趣的朋友们一起来看看吧。

表格的分组显示(Structured Table) (IExplore Only)
1)按行分组
<thead> … </thead> – 表的题头(Header) <tbody> … </tbody> – 表的正文(Body) <tfoot> … </tfoot> – 表的脚注(Footer)
例: <table border> <thead> <tr><th>Food</th><th>Drink</th><th>Sweet</th> </thead> <tbody> <tr><td>A</td><td>B</td><td>C</td> <tr><td>D</td><td>E</td><td>F</td> </tbody> </table>
2)按列分组
<colgroup align=#> #=left, right, center
例: <table border width=160> <colgroup align=left> <colgroup align=center> <colgroup align=right> <thead> <tr><th>Food</th><th>Drink</th><th>Sweet</th> </thead> <tbody> <tr><td>A</td><td>B</td><td>C</td> <tr><td>D</td><td>E</td><td>F</td> </tbody> </table>
3)列的属性控制
<col span=#> #=从左数起,具有指定属性的列的列数 <col align=#> #=left, right, center
例: <table border width=160> <colgroup> <col align=center span=2> <colgroup align=right> <thead> <tr><th>Food</th><th>Drink</th><th>Sweet</th> </thead> <tbody> <tr><td>A</td><td>B</td><td>C</td> <tr><td>D</td><td>E</td><td>F</td> </tbody> </table>

以上就是html tbody的用法介绍,我们在做原型页面时会为了实现交互效果才用<tbody>,实际的后台编程中用不着,只要根据判断输出相应的表体就行了。