合并表css

时间:2012-10-06 02:57:45

标签: html css

我有这样的HTML表格:

-------------------------------------------------
|Column 1                   |Column 2           |
-------------------------------------------------
|this is the text in column |this is the column |
|one which wraps            |two test           |
-------------------------------------------------

但我不希望第二行像这样只有一列:

-------------------------------------------------
|Column 1                   |Column 2           |
-------------------------------------------------
|this is the text in column |this is the column |
|one which wraps two test                       |
-------------------------------------------------

当我在列上使用rowspan时,上面的列会不断扩展。

1 个答案:

答案 0 :(得分:3)

第一个给colspan =“2”,之后没有。

有些事情如下

<table>
    <tr>
        <td>
            this is the text in column
        </td>
        <td>
            this is the column
        </td>
    </tr>
    <tr>
        <td colspan="2">
            one which wraps two test
        </td>
    </tr>
</table>