html th 3 cells rowpan colspan

时间:2013-08-07 15:47:15

标签: html html5 html-table

我对rowspancolspan不够熟悉......

我正在尝试使用html(也许是CSS?):

------------------------------------------
|          |    Divided col    |         |
|          |___________________|         |
| Col 1    | part a  | part b  |  Col 3  |
|          |         |         |         |
------------------------------------------
|  data 1  | data 2a | data 2b |  data 3 |

这可能吗? 或者只是使用某种图像?

2 个答案:

答案 0 :(得分:2)

不确定

<table border='1'>
    <tr>
        <td rowspan='2'>
            COL1
        </td>
        <td colspan='2'>
            Divided col
        </td>
        <td rowspan='2'>
            Col 3
        </td>
    </tr>
    <tr>
        <td>
            part a
        </td>
        <td>
            part b
        </td>
    </tr>
    <tr>
        <td>Data 1</td>
        <td>Data 2a</td>
        <td>Data 2b</td>
        <td>Data 3</td>
    </tr>
</table>

答案 1 :(得分:2)

<强> jsFiddle example

<table>
    <tr>
        <td rowspan="2">Col 1</td>
        <td colspan="2">Divided col</td>
        <td rowspan="2">Col 3</td>
    </tr>
    <tr>
        <td>part a</td>
        <td>part b</td>
    </tr>
    <tr>
        <td>data 1</td>
        <td>data 2a</td>
        <td>data 2b</td>
        <td>data3</td>
    </tr>
</table>