Html表'子类别'到'类别'

时间:2014-03-05 18:21:42

标签: html css html-table

我在制作一张桌子方面遇到了问题,到目前为止我做了什么:

[table1](http://postimg.org/image/j9ldx93y5/)

我希望实现这一目标:

[table2](http://postimg.org/image/7q93bz2fd/)

<table id="table_groups" align="center" border="1" class="main_table2">

<thead align="left" class="tableheader">
    <tr>
    <th rowspan="2" align="left" valign="middle" style="text-decoration:none;"><th colspan="2" align="left" valign="middle" style="text-decoration:none;">Group</th></th>
    <th rowspan="2" align="left" valign="middle" style="text-decoration:none;">Permisions</th>
    </tr>
    <tr><th>Name</th><th>Ident</th></tr>
    </thead>

<tbody>
<tr>    
<td align="center"></td>
<td align="center"></td>
<td align="center"></td>
<td align="center"></td>
</tr>
</tbody>
</table>

1 个答案:

答案 0 :(得分:1)

<table id="table_groups" align="center" border="1" class="main_table2">
    <thead align="left" class="tableheader">
        <tr>
            <th colspan="2" align="left" valign="middle" style="text-decoration: none;">
            Group</th>
            <th rowspan="2" align="left" valign="middle" style="text-decoration: none;">
            Permisions</th>
        </tr>
        <tr>
            <th>Name</th>
            <th>Ident</th>
        </tr>
    </thead>
    <tr>
        <td align="center"></td>
        <td align="center"></td>
        <td align="center"></td>
    </tr>
    <tr>
        <td align="center">&nbsp;</td>
        <td align="center">&nbsp;</td>
        <td align="center">&nbsp;</td>
    </tr>
</table>

请注意,不推荐使用alignvalign属性。例如,align="center"应该是style="text-align:center"