2016-09-28 43 views
2

如何只在我預期的那樣下面的示例中的字段添加邊框,製作的HTML邊界在特定列

<table width="500" border="1"> 
 
    <tr> 
 
\t \t <td>no border</td> 
 
\t \t <td>no border</td> 
 
\t \t <td>Just</td> 
 
    </tr> 
 
    <tr> 
 
\t \t <td>no border</td> 
 
\t \t <td>no border</td> 
 
\t \t <td>Border</td> 
 
    </tr> 
 
    <tr> 
 
\t \t <td>no border</td> 
 
\t \t <td>no border</td> 
 
\t \t <td>here 1 box</td> 
 
    </tr> 
 
</table>

回答

1

你可以嘗試添加一個類,你希望這些具體td。我也刪除了border=1<table border="1">

HTML:

<table width="200"> 
<tr> 
    <td>&nbsp;</td> 
    <td>&nbsp;</td> 
    <td class="modified-td-top">Just</td> 
</tr> 
<tr> 
    <td>&nbsp;</td> 
    <td>&nbsp;</td> 
    <td class="modified-td-middle">Border</td> 
</tr> 
<tr> 
    <td>&nbsp;</td> 
    <td>&nbsp;</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; 
} 
+0

謝謝@ gosi123不太精確,我只想把邊界只作爲第3列沒有中間線作爲合併 –

+0

好吧我已經編輯它,請現在檢查它。 – gosi123

+0

是的gosi it'solve謝謝 –

0

這是什麼ü意思?

編輯

<table width="200" style="border:1px solid black;"> 
 
    <tr style="border:none"> 
 
\t \t <td>&nbsp;</td> 
 
\t \t <td>&nbsp;</td> 
 
\t \t <td>Just</td> 
 
    </tr> 
 
    <tr style="border:none"> 
 
\t \t <td>&nbsp;</td> 
 
\t \t <td>&nbsp;</td> 
 
\t \t <td>Border</td> 
 
    </tr> 
 
    <tr style="border:none"> 
 
\t \t <td>&nbsp;</td> 
 
\t \t <td>&nbsp;</td> 
 
\t \t <td>here</td> 
 
    </tr> 
 
</table>

+0

略顯不足,所以在3列成一箱 –

+0

@dwiyanto嗯,香港專業教育學院編輯 – deviantxdes

+0

沒有,所以在中間的行缺少,如合併 –