html rowspan colspan代码示例

<html>

    <body>

        <table border="1">

            <tr>

                <td rowspan="4">AAA</td><td>111</td><td>222</td><td>333</td> <!-- 列合并4个td -->

            </tr>

            <tr>

                <td>444</td><td>555</td><td>666</td>  <!-- 列少一个td -->

            </tr>

            <tr>

                <td>777</td><td>888</td><td>999</td>  <!-- 列少一个td -->

            </tr>

            <tr>

                <td>000</td><td>aaa</td><td>bbb</td>  <!-- 列少一个td -->

            </tr>

        </table>

        

        <table border="1">

            <tr>

                <td colspan="4">AAA</td> <!-- 行合并4个td -->

            </tr>

            <tr>

                <td>444</td><td>444</td><td>555</td><td>666</td>  

            </tr>

            <tr>

                <td>444</td><td>777</td><td>888</td><td>999</td>  

            </tr>

            <tr>

                <td>444</td><td>000</td><td>aaa</td><td>bbb</td>  

            </tr>

        </table>

    </body>

</html>

 

你可能感兴趣的:(html)