gpt4 book ai didi

html - 如何在表格中沿 / 标签添加边框

转载 作者:行者123 更新时间:2023-11-28 00:09:32 25 4
gpt4 key购买 nike

当我使用下面的代码时,我可以获得背景颜色,但不能获得 td 标签上的边框。我也无法在两个 td 标签之间添加间距。我尝试了 cellspacing 和 cellpadding

.bd-highlight {
margin: 12px 12px 12px 12px;
padding-right: 20px;
border-radius: 25px;
background: #73AD21;
padding: 20px;
width: 135px;
height: 10px;
border-color: white;
}
<div class="row" id="columntab">
<div class="col-6" id="columnmain">
<table class="t1" cellspacing="10">
<tbody>
<tr>
<th class="bd-highlight"><a href="download/EXTC/SEM3 CBCGS/EIC/SE-EXTC_SEM3_EIC-CBCGS_DEC18.pdf" download="">Dec 2018</a></th>
<th><a href="download/EXTC/SEM3 CBCGS/EIC/SE-EXTC_SEM3_EIC-CBCGS_MAY18.pdf" download="">May 2018</a></th>
<th><a href="download/EXTC/SEM3 CBCGS/EIC/SE-EXTC_SEM3_EIC-CBCGS_DEC17.pdf" download="">Dec 2017</a></th>
</tr>
</tbody>
</table>
</div>
<div class="col-3">
2 of 3 (wider)
</div>
<div class="col-3">
3 of 3
</div>
</div>

最佳答案

你必须使用border:5px(border-width) solid(type) #ff0000(custom-color);

   table tbody tr td,
table tbody tr th
{
margin: 12px 12px 12px 12px;
padding-right: 20px;
border-radius: 25px;
background: #73AD21;
padding: 20px;
width: 135px;
height: 10px;
border:5px solid #f00;
}

/*.bd-highlight {
margin: 12px 12px 12px 12px;
padding-right: 20px;
border-radius: 25px;
background: #73AD21;
padding: 20px;
width: 135px;
height: 10px;
border-color: white;
}*/

table tbody tr td,
table tbody tr th
{
margin: 12px 12px 12px 12px;
padding-right: 20px;
border-radius: 25px;
background: #73AD21;
padding: 20px;
width: 135px;
height: 10px;
border:5px solid #f00;
}
<div class="row" id="columntab">
<div class="col-6" id="columnmain">
<table class="t1" cellspacing="10">
<tbody>
<tr>
<th class="bd-highlight"><a href="download/EXTC/SEM3 CBCGS/EIC/SE-EXTC_SEM3_EIC-CBCGS_DEC18.pdf" download="">Dec 2018</a></th>
<th><a href="download/EXTC/SEM3 CBCGS/EIC/SE-EXTC_SEM3_EIC-CBCGS_MAY18.pdf" download="">May 2018</a></th>
<th><a href="download/EXTC/SEM3 CBCGS/EIC/SE-EXTC_SEM3_EIC-CBCGS_DEC17.pdf" download="">Dec 2017</a></th>
</tr>
</tbody>
</table>
</div>
<div class="col-3">
2 of 3 (wider)
</div>
<div class="col-3">
3 of 3
</div>
</div>

关于html - 如何在表格中沿 <td>/<th> 标签添加边框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55474757/

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