表格跨列,在CSS样式里怎么写

html-css020

表格跨列,在CSS样式里怎么写,第1张

跨列指的是什么

如果是让里面的标签先是到或覆盖几个列的话

你在表格里面的 最外层标签里 写style="position:absolutewidth:500px"

width自己修改成想要的数

这种涉及到 colspan, rowspan 复杂的表格,最好用可视化编辑器来做。

第一个表格

<table border="5" width="300" bordercolor="#ff0000">

    <tr>

        <td colspan="2">11</td>

        <td>11</td>

    </tr>

    <tr>

        <td>11</td>

        <td>11</td>

        <td>11</td>

    </tr>

    <tr>

        <td>11</td>

        <td colspan="2">11</td>

    </tr>

</table>

第二个表格

<table border="1" width="300" cellspacing="10" cellpadding="10" bordercolor="#ff0000">

    <tr>

        <td rowspan="2">

        <table border="1" width="100%" bordercolor="#0000ff">

            <tr>

                <td rowspan="2">33</td>

                <td>33</td>

                <td>33</td>

            </tr>

            <tr>

                <td>33</td>

                <td>33</td>

            </tr>

        </table>

        </td>

        <td>22</td>

        <td>22</td>

    </tr>

    <tr>

        <td>22</td>

        <td rowspan="2">

        <table border="1" width="100%" bordercolor="#555555">

            <tr>

                <td rowspan="2">66</td>

                <td>55</td>

                <td>55</td>

            </tr>

            <tr>

                <td colspan="2">55</td>

            </tr>

        </table>

        </td>

    </tr>

    <tr>

        <td>22</td>

        <td>22</td>

    </tr>

</table>