How to set the color of table lines in html

青灯夜游
Release: 2023-01-06 11:13:18
Original
15928 people have browsed it

In HTML, you can set the color of the table line by adding the border attribute to the table and td elements. The specific syntax format is "table,td {border: border line width style color value;}".

How to set the color of table lines in html

The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.

After adding a border to the table tag using the border attribute, the default border line color is black:

<table border="1">
			<tr>
				<td>商品</td>
				<td>价格</td>
			</tr>
			<tr>
				<td>T恤</td>
				<td>¥100</td>
			</tr>
			<tr>
				<td>牛仔褂</td>
				<td>¥250</td>
			</tr>
			<tr>
				<td>牛仔库</td>
				<td>¥150</td>
			</tr>
		</table>
Copy after login

How to set the color of table lines in html

We can add borders to the table through css.

Only set the border style for table and td tags.

table,td {
border:1px solid pink;
}
Copy after login

Rendering:

How to set the color of table lines in html

Recommended tutorials: "html video tutorial", "css video tutorial

The above is the detailed content of How to set the color of table lines in html. 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