What properties are used to set CSS table borders?

(*-*)浩
Release: 2019-11-28 14:29:39
Original
5250 people have browsed it

What properties are used to set CSS table borders?

Table border

If you need to set the table border in CSS, please use the border attribute. (Recommended learning: CSS Introduction Tutorial)

The following example sets blue borders for table, th and td:

<html>
<head>
<style type="text/css">
table,th,td
{
border:1px solid blue;
}
</style>
</head>

<body>
<table>
<tr>
<th>Firstname</th>
<th>Lastname</th>
</tr>
<tr>
<td>Bill</td>
<td>Gates</td>
</tr>
<tr>
<td>Steven</td>
<td>Jobs</td>
</tr>
</table>
</body>
</html>
Copy after login

Note that the table in the example above has a double line border. This is because the table, th and td elements have independent borders.

If you need to display the table as a single line border, please use the border-collapse attribute.

The above is the detailed content of What properties are used to set CSS table borders?. 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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!