Html 如何垂直拆分表格单元格

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6301172/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 09:02:36  来源:igfitidea点击:

How to split a table cell vertically

htmlcsscell

提问by keruilin

I know a similar question on this topic has been asked, but doesn't look like there was a definitive solution. So with that, here's my fiddle:

我知道有人问过关于这个主题的类似问题,但似乎没有明确的解决方案。因此,这是我的小提琴:

http://jsfiddle.net/UjAQf/24/

http://jsfiddle.net/UjAQf/24/

I want to split the table cell under the "Pick" heading vertically. I'd prefer a solution that doesn't require JS or anything wonky, if possible.

我想垂直拆分“选择”标题下的表格单元格。如果可能的话,我更喜欢不需要 JS 或任何奇怪的东西的解决方案。

采纳答案by Kyle Sletten

You can't really split a cell vertically, but if you add another cell after it in each of the table body rows and give the heading row a colspan="2"you can have two different cells under one heading.

您不能真正垂直拆分单元格,但是如果您在每个表格正文行中在它之后添加另一个单元格并指定标题行 acolspan="2"您可以在一个标题下有两个不同的单元格。

http://jsfiddle.net/UjAQf/26/

http://jsfiddle.net/UjAQf/26/

回答by Felipe Sabino

Actually you could have used rowspan=2HTML property for the other cells, and then you could have you cell splited vertically

实际上,您可以rowspan=2对其他单元格使用HTML 属性,然后您可以将单元格垂直拆分

http://jsfiddle.net/Ty44J/

http://jsfiddle.net/Ty44J/

http://www.w3schools.com/tags/att_td_rowspan.asp

http://www.w3schools.com/tags/att_td_rowspan.asp