HTML Tutorial
Menu
HTML Forms
Menu
HTML Graphics
Menu
HTML Media
Menu
HTML API
Menu
HTML Table Borders
How To Add a Border
To add a border to a table, borders around each table cell are also added:
Example:
table, th, td {
border: 1px solid black;
}
Firstname
Lastname
Age
Output:
Firstname | Lastname | Age |
---|
Style Table Border
Style table background table border radius for rounded table border and giving border white.
table, th, td {
border: 1px solid white;
border-collapse: collapse;
border-radius:5px;
}
th, td {
background-color: #96D4D4;
}
Firstname
Lastname
Age
Jill
Smith
50
Output:
Firstname | Lastname | Age |
---|---|---|
Jill | Smith | 50 |
Style Table Border
The border-style property allows setting the appearance of the border.
The following values are allowed:
- dotted
- dashed
- solid
- double
- groove
- ridge
- inset
- outset
- none
- hidden
Example
th, tr {
border:1px dotted black;
}
Firstname
Lastname
Age
Output:
Firstname | Lastname | Age |
---|