How to set the color of table lines in html

青灯夜游
Release: 2023-01-06 11:13:18
Original
15789 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:

商品 价格
T恤 ¥100
牛仔褂 ¥250
牛仔库 ¥150
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
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!