Many friends are very troubledTableHow to set the style. I mentioned before that I set borders on the table. Today I will show you how to use CSS to set borders on td. In the future, we will continue toupdate tips and settings about tables, so please continue to pay attention.
Set the border style for the table td. The td within the table object will implement the border style, but the middle part of the td will cause double borders to appear.
The detailed case tutorial is as follows:
1. Corresponding css code
<style> .table-b table td{border:1px solid #F00} /* css注释:只对table td标签设置红色边框样式 */ </style>
2. Corresponding html source code fragment
<div class="table-b"> <table width="400" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="105">站名</td> <td width="181">网址</td> <td width="112">说明</td> </tr> <tr> <td>PHP</td> <td>www.php.cn</td> <td>PHP</td> </tr> <tr> <td>PHP</td> <td>www.php.cn</td> <td>PHP</td> </tr> </table>
This is to use CSS to set td Have you learned the border method?
Related reading:
##Some points to note in css layoutThe above is the detailed content of How to set borders on td using CSS. For more information, please follow other related articles on the PHP Chinese website!