How to set borders on td using CSS

php中世界最好的语言
Release: 2017-11-20 17:30:47
Original
5229 people have browsed it

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>
Copy after login

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>
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!