In CSS, you can use the border-right attribute to set the right border of the table. The function of this attribute is to specify the width, style and color of the right border of the element. The syntax "table{border-right: border width border" Style border color;}".
The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.
In css, the border-right attribute can be used to set the right border of the table.
The border-right property is a shorthand property that sets all properties of the right border into one statement.
The properties that can be set are (in order): border-right-width, border-right-style, and border-right-color.
Example:
The default table is borderless:
<table> <tr> <th>姓名</th> <th>年龄</th> </tr> <tr> <td>Peter</td> <td>20</td> </tr> <tr> <td>Lois</td> <td>20</td> </tr> </table>
You only need to set the border-right attribute to the table element , you can add a right border
table{ border-right: 1px solid red; }
(Learning video sharing: css video tutorial)
The above is the detailed content of How to set the right border of the table in css. For more information, please follow other related articles on the PHP Chinese website!