如何创建包含2行和不同列的表

时间:2012-10-01 04:33:36

标签: html html-table multiple-columns

我想创建一个包含2行的表。第一行包含2列大小相等的列,第二列应包含3列大小相等的列。

是否可以在HTML中设计此类表格?

我不想使用嵌套表;使用单表是否可以实现?

enter image description here

3 个答案:

答案 0 :(得分:3)

<table border=1 width=200>
    <tr><td colspan=2>&nbsp;</td>
        <td colspan=2>&nbsp;</td>
    </tr>
    <tr><td>&nbsp;</td>
        <td colspan=2>&nbsp;</td>
        <td>&nbsp;</td>
    </tr>
</table>

答案 1 :(得分:1)

我的2美分

<table class="mytable">
    <tr>
        <td colspan="3"></td>
        <td colspan="3"></td>
    </tr>
    <tr>
        <td colspan="2"></td>
        <td colspan="2"></td>
        <td colspan="2"></td>
    </tr>
</table>

小提琴:http://jsfiddle.net/eJ7ts/

答案 2 :(得分:1)

试试这个

<table width=300 >
    <tr><td colspan=2>&nbsp;</td>
        <td colspan=2>&nbsp;</td>
    </tr>
    <tr><td>&nbsp;</td>
        <td colspan=2>&nbsp;</td>
        <td>&nbsp;</td>
    </tr>
</table>

小css

 td
{
    border: 2px solid #000;
    height:50px;
}

拨弄

http://jsfiddle.net/Ah9AE/

相关问题