-2

点击这里查看结构

每个表格单元格都用一个字母标识,所有尺寸都以像素为单位。表格中显示的字母和尺寸不得出现在您的最终网页上。外部表格边框的宽度必须为 4 像素,表格上的所有内部网格线的宽度必须为 2 像素。表格边框和网格线必须可见。

<!DOCTYPE html>
<html>

<head>
    <title> Nested Table </title>
</head>

<body>

    <table border="4px" align="center" width=100%>

        <tr>
            <td height="300px" width="400px"> A 400 X 300 </td>
            <td height="300px" width="400px"> B 400 X 300 </td>
            <td height="300px" width="400px"> C 400 X 300 </td>
        </tr>

        <tr>
            <td colspan=3 height="250px" width="1200px"> D 1200 X 250 </td>
        </tr>

        <tr>
            <td colspan=3 height="150px" width="1200px"> E 1200 X 150 </td>
        </tr>
        <tr>
            <table border="4" align="center">
                <tr>
                    <td height="300px" width="50%"> F 600 X 300 </td>
                    <td height="300px" width="600px"> G 600 X 300 </td>
                </tr>
        </tr>
        </table>

</html>

4

1 回答 1

0

tr:first-child td{
height:100px;
width:100px;
}
tr:nth-child(2) td{
height:60px;
}
tr:nth-child(3) td{
height:40px;
}
tr:nth-child(4) td{
height:100px;
width:50%;
}
<table border="1">
<tr>
 <td>
 </td>
 <td>
 </td>
 <td>
 </td>
</tr>
<tr>
 <td colspan = "3">
 </td>
</tr>
<tr>
 <td colspan = "3">
 </td>
</tr>
<tr>
 <td colspan = "2">
 </td>
 <td>
 </td>
</tr>
</table>

于 2020-05-22T19:21:44.037 回答