gpt4 book ai didi

HTML 表格 td 左边框颜色不随 rowspan 更新

转载 作者:太空宇宙 更新时间:2023-11-04 08:02:45 25 4
gpt4 key购买 nike

我有带 rowspan 的 HTML 表格,我想 td 使用不同的左边框颜色

HTML Code;

<table class="table">
<tr>
<td class ="fail-td" rowspan="2">Detail</td>
<td class ="fail-td">Data 1</td>
<td class="event">Event</td>
</tr>
<tr> <td class ="success-td">Data 2</td></tr>

</table>


Snippet:



.fail-td {
border-left: 4px solid #d9534f !important;
}
.success-td {
border-left: 4px solid #5cb85c !important;
}

预期输出为 rowspan 第二行 td 左边框为绿色但结果是 td 左边框为红色 enter image description here

最佳答案

设置 fail-td class name of second td of data 1 value

.fail-td {
border-left: 4px solid #d9534f !important;
}

.success-td {
border-left: 4px solid #5cb85c !important;
}
<table class="table">
<tr>
<td class="fail-td" rowspan="2">Detail</td>
<td class="fail-td">Data 1</td>
<td class="event">Event</td>
</tr>
<tr>
<td class="success-td">Data 2</td>
</tr>

</table>

关于HTML 表格 td 左边框颜色不随 rowspan 更新,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46886426/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com