[英]Border around a column in a html table with certain rows having a collspan
I have an HTML table displaying a calendar.我有一个显示日历的 HTML 表。 People are divided in groups.
人们被分成几组。 The names of the groups can be very long.
组的名称可能很长。
Two requirements:两个要求:
For requirement 1, I simply set a colspan
on the td
containing the name of the group.对于要求 1,我只需在
td
上设置一个包含组名称的colspan
。
<td colspan="31">The name of a group can be very long</td>
For requirement 2, I set a border on the correct column
in the columngroup
.对于要求 2,我在
columngroup
中的正确column
上设置了边框。
<colgroup>
<col>
<col>
<col>
<col class="planningtable_todaycolumn">
</colgroup>
Now the issue is that the border breaks on the group rows, instead of just continuing.现在的问题是边框在组行上中断,而不仅仅是继续。
How can I fix this?我怎样才能解决这个问题? I have been looking into fixing problem 1 in another way than using a
colspan
.我一直在研究以另一种方式解决问题 1,而不是使用
colspan
。 Because when I'm not using a colspan
the issue is solved automatically.因为当我不使用
colspan
时,问题会自动解决。 But I could not find usable solutions.但我找不到可用的解决方案。
Also been thinking about another way to draw the border.也一直在想另一种画边界的方法。 But in the group row, there is no element to give a border, so I have no idea how to fix that.
但是在组行中,没有提供边框的元素,所以我不知道如何解决这个问题。
By reading the link @Bobtroopo provided I came up with a solution:通过阅读@Bobtroopo 提供的链接,我想出了一个解决方案:
Don't use a colspan for the group cells.不要对组单元格使用 colspan。
But give them a position style:但是给他们一个 position 风格:
position: absolute
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.