如何仅在我期望的字段上添加边框,如下例所示,
<table width="500" border="1">
<tr>
<td>no border</td>
<td>no border</td>
<td>Just</td>
</tr>
<tr>
<td>no border</td>
<td>no border</td>
<td>Border</td>
</tr>
<tr>
<td>no border</td>
<td>no border</td>
<td>here 1 box</td>
</tr>
</table>
&#13;
答案 0 :(得分:1)
您可以尝试将类添加到您想要的特定td
。我还从border=1
<table border="1">
HTML:
<table width="200">
<tr>
<td> </td>
<td> </td>
<td class="modified-td-top">Just</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td class="modified-td-middle">Border</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td class="modified-td-bottom">here</td>
</tr>
</table>
CSS:
table {border:0px;border-collapse: collapse;}
.modified-td-middle {
border-left:1px solid black;
border-right:1px solid black;
}
.modified-td-top {
border-top: 1px solid black;
border-left: 1px solid black;
border-right: 1px solid black;
}
.modified-td-bottom {
border-bottom: 1px solid black;
border-right: 1px solid black;
border-left: 1px solid black;
}
答案 1 :(得分:0)
这就是你的意思吗?
修改强>
<table width="200" style="border:1px solid black;">
<tr style="border:none">
<td> </td>
<td> </td>
<td>Just</td>
</tr>
<tr style="border:none">
<td> </td>
<td> </td>
<td>Border</td>
</tr>
<tr style="border:none">
<td> </td>
<td> </td>
<td>here</td>
</tr>
</table>