Home > Web Front-end > Front-end Q&A > How to set css table border

How to set css table border

藏色散人
Release: 2021-06-08 11:13:55
Original
3289 people have browsed it

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

css:

table{border:1px solid skyblue;}
Copy after login

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

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

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!

Related labels:
css
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