首页 > WEB应用开发 > 表格的标准化写法

表格的标准化写法

2009年1月3日
阅读(1492) 评论 发表评论

HMTL中表格标准写法的一个比较完整的实例,仅供参考

结合了thead,tfoot,th的应用,还有CSS控制表格
注意:

  1. tfoot在fbody前面
  2. td,th,tr,thead,tfoot,tbody都可以省略结束标记
  3. th不仅仅用在表头中
Title

=

=

=

=

=

=

=

=

=

=

=

B

-

-

-

-

+

B

-

-

-

-

+

B

-

-

-

-

+

B

-

-

-

-

+

B

-

-

-

-

+

WordPress在保存会自作聪明的做一些源码改写操作,同时上面的表格也会受到wordpress本身的CSS影响,所以代码请以下面部分的源码为准

<style>
table#test{
    border: 2px solid blue;
    border-spacing: 1px;
    padding: 2px;
    width: 100%;
}
</style>
<table id="test">
  <thead>
    <tr>
        <th> Title
        <td> =
        <td> =
        <td> =
        <td> =
        <th> =
<tfoot>
    <tr>
        <th> =
        <td> =
        <td> =
        <td> =
        <td> = 
        <th> =
<tbody>
    <tr class="trAlt1">
        <th> B
        <td> -
        <td> -
        <td> -
        <td> -
        <th> +
    <tr class="trAlt2">
        <th> B
        <td> -
        <td> -
        <td> -
        <td> -
        <th> +
    <tr class="trAlt2">
        <th> B
        <td> -
        <td> -
        <td> -
        <td> -
        <th> +
    <tr class="trAlt2">
        <th> B
        <td> -
        <td> -
        <td> -
        <td> -
        <th> +
</table>

WEB应用开发 , ,

  1. 目前还没有任何评论.
  1. 目前还没有任何 trackbacks 和 pingbacks.