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

How to set css table border

藏色散人
藏色散人Original
2021-06-08 11:13:553159browse

How to set the css table border: 1. Set the outer border through "table{border:1px solid skyblue;}"; 2. Set the cell border through "td{border:1px solid skyblue;}".

How to set css table border

The operating environment of this article: windows7 system, HTML5&&CSS3 version, DELL G3 computer

can use border:1px solid skyblue;

1px is the border pixel, solid means the border is solid, skyblue is the border color, if the table is set directly, it is just the outer border, such as:

<table>
    <tr>
        <td>11111</td>
        <td>111111</td>
    </tr>
    <tr>
        <td>11111</td>
        <td>111111</td>
    </tr>
</table>

css:

table{border:1px solid skyblue;}

Rendering:

How to set css table border

If you set the cell border, you can make each cell have a border, such as:

td{border:1px solid skyblue;}

Rendering:

How to set css table border

The style to set the cell spacing to 0 is:

table{border-collapse:collapse;}
td{border:1px solid skyblue;}

Rendering:

How to set css table border

Recommended study: "css video tutorial

The above is the detailed content of How to set css table border. 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