Home  >  Article  >  Web Front-end  >  How to use css to not display the border of the table

How to use css to not display the border of the table

王林
王林Original
2020-11-13 11:25:244910browse

How to use css to not display the border of the table: You can use the border attribute, such as [border:0;]. The border attribute is used to set all border attributes, such as border-width, which specifies the width of the border.

How to use css to not display the border of the table

#border shorthand property sets all border properties in one declaration.

(Learning video sharing: css video tutorial)

You can set the following attributes in order:

  • border-width

  • border-style

  • border-color

If one of the values ​​is not set, There will be no problem. For example, border:solid #ff0000; is also allowed.

Attribute value:

border-width    规定边框的宽度。
border-style    规定边框的样式。   
border-color    规定边框的颜色。
inherit    规定应该从父元素继承 border 属性的设置。

Code example:

<html>
<head>
</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>

css

<style type="text/css">
table,th,td
{
border:0;
}
</style>

Result:

How to use css to not display the border of the table

Related videos: CSS tutorial

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