将边框底部添加到表格行 <tr>; [英] Add border-bottom to table row <tr>
问题描述
我有一个 3 x 3 的表格.我需要一种方法来为每一行的底部添加边框 tr
并给它一个特定的颜色.
I have a table of 3 by 3. I need a way to add a border for the bottom of every row tr
and give it a specific color.
首先我尝试了直接的方式,即:
First I tried the direct way, i.e.:
<tr style="border-bottom:1pt solid black;">
但这没有用.所以我添加了这样的 CSS:
But that didn't work. So I added CSS like this:
tr {
border-bottom: 1pt solid black;
}
那还是不行.
我更喜欢使用 CSS,因为这样我就不需要向每一行添加 I would prefer to use CSS because then I don't need to add a 我以前也遇到过这样的问题.我不认为 I had a problem like this before. I don't think CSS: 这篇关于将边框底部添加到表格行 <tr>;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!style
属性.我没有向 添加
border
属性.我希望这不会影响我的 CSS.
style
attribute to every row.
I haven't added a border
attribute to the <table>
. I hope that that is not affecting my CSS.推荐答案
tr
可以直接采用边框样式.我的解决方法是在行中设置 td
的样式:tr
can take a border styling directly. My workaround was to style the td
s in the row:<tr class="border_bottom">
tr.border_bottom td {
border-bottom: 1px solid black;
}
登录
关闭