Home  >  Article  >  Web Front-end  >  How to set table lines in css

How to set table lines in css

藏色散人
藏色散人Original
2021-04-12 16:11:224296browse

How to set the table line in css: first create a new html file; then use the table tag to create a table with two rows and two columns; then set the id of the table table to testable; finally use the border attribute to set the table line to 1px The red line is enough.

How to set table lines in css

The operating environment of this article: Windows7 system, HTML5&&CSS3 version, Dell G3 computer.

Create a new HTML file, named test.html, to explain how to use CSS to control the color of table lines.

How to set table lines in css

In the test.html file, use the table tag to create a table with two rows and two columns for testing.

How to set table lines in css

In the test.html file, set the id of the table table to testable, which is mainly used to set the style below.

How to set table lines in css

In the test.html file, write the tag of the page The css style will be written inside this tag.

How to set table lines in css

In the css tag, set the outer border and cell style of the table through id, and use the border attribute to set the table line to a 1px red line.

How to set table lines in css

Open the test.html file in the browser to check the effect.

How to set table lines in css

[Recommended learning: css video tutorial]

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