简体   繁体   English

结合colspan和rowpan的HTML表

[英]HTML Table combining colspan and rowspan

I'm trying to make a html table with the following layout: 我正在尝试使用以下布局制作html表:

+-------+---+
|       |   |
+-------+   +
|       |   |
+-----+-----+
|     |     |
+-----+-----+

I am using a colgroup to divide the entire table into 5% pieces, and then applying colspan and rowspan to combine some pieces together. 我正在使用colgroup将整个表分成5%,然后应用colspanrowspan将一些部分组合在一起。 So far, I've had no success. 到目前为止,我还没有成功。 I am wondering if anyone could point me in the right direction. 我想知道是否有人可以指出我正确的方向。 A table is needed to accommodate email styling possibilities. 需要一张桌子来容纳可能的电子邮件样式。

EDIT: https://plnkr.co/edit/CHmiOuKpUlPsVJanLl7l?p=preview Code as requested 编辑: https//plnkr.co/edit/CHmiOuKpUlPsVJanLl7l? p =要求的预览代码

To get your exact colspan and rowspan you would have to do something like this: 要获得确切的colspan和rowpan,您必须执行以下操作:

<table>
  <tr>
    <td colspan="3"></td>
    <td rowspan="2"></td>
  </tr>
  <tr>
    <td colspan="3"></td>
  </tr>
  <tr>
    <td colspan="2"></td>
    <td colspan="2"></td>
  </tr>
</table>

Here's the code in action: 这是运行中的代码:

https://jsfiddle.net/npjkrb55/1/ https://jsfiddle.net/npjkrb55/1/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM