开发者

How do I create this table?

开发者 https://www.devze.com 2023-03-06 04:37 出处:网络
---------------------------- C|D| |A|B|------+-----开发者_StackOverflow社区| E| F| ----------------------------
----------------------------
|     |       |  C   |  D  |
|  A  |   B   |------+-----开发者_StackOverflow社区|
|     |       | E    | F   |
----------------------------

Both A and B need a ROWSPAN of 2. What's the HTML for that?


This should do what you're looking for:

<table>
  <tr>
    <td rowspan="2">A</td>
    <td rowspan="2">B</td>
    <td>C</td>
    <td>D</td>
  </tr>
  <tr>
    <td>E</td>
    <td>F</td>
  </tr>
</table>


First off, if you're using this for a layout, don't. Use divs and CSS.

If you're using tabular data, then:

<table>
    <tr>
        <td rowspan="2">A</td>
        <td rowspan="2">B</td>
        <td>C</td>
        <td>D</td>
    </tr>
    <tr>
        <td>C</td>
        <td>D</td>
    </tr>
</table>
0

精彩评论

暂无评论...
验证码 换一张
取 消