HTML表格中的表格

时间:2013-12-20 07:11:07

标签: html html-table

好的,我必须定义下表:

enter image description here

我已经工作了至少30分钟,但我无法弄清楚如何制作它。我需要解释表中的表如何工作以及如何创建上表。

<html>
<body>

<table border="1" cellspacing="0" width="800px" height="600px">
    <tr>
        <td height=120px>

        </td>
        <td width=280px>
            <table>
                <tr>
                    <td height=300px>

                    </td>
                </tr>
            </table>
        </td>
    </tr>

    <tr>

    </tr>
</table>

</body>
</html>

1 个答案:

答案 0 :(得分:3)

您不需要多个表

使用表格单元格的rowspan和colspan属性

要了解使用rowspan和colspan的位置,请拍摄照片并继续划分表格单元格以跨越整个表格的所有行。您将看到需要使用rowspan垂直连接或使用colspan水平连接的内容。

<table>
<tr>
    <td colspan=2 width=500 height=120></td>
    <td rowspan=2 width=270 height=300></td>
</tr>
<tr>
    <td rowspan=2 width=120></td>
    <td rowspan=2 width=400></td>       
</tr>
<tr>            
    <td height=300></td>
</tr>
</table>

如果您仍然需要表格,我会在这里创建3个表格 - 右上角和左下角

    <table heigth=600 width=800 border=1>
    <tr>
        <td height=120 width=520>1</td>
        <td rowspan=2 width=270 height=600 valign=top>
            <table valign=top border=1 width=270>
                <tr><td height=300>2</td></tr>
                <tr><td height=300>3</td></tr>
            </table>
        </td>
    </tr>
    <tr>
        <td valign=top>
            <table width=520 border=1 height=480>
                <tr>
                    <td width=120>4</td>
                    <td width=400>5</td>
                </tr>
            </table>
        </td>
    </tr>
    </table>
相关问题