Home  >  Article  >  Web Front-end  >  How to set borders on td using CSS

How to set borders on td using CSS

php中世界最好的语言
php中世界最好的语言Original
2017-11-20 17:30:475265browse

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:

How to use CSS to set borders only for table labels


## Using DIV and CSS to make drop-down menus


##Some points to note in css layout

The 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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn