HTML Tutorial
Menu
HTML Forms
Menu
HTML Graphics
Menu
HTML Media
Menu
HTML API
Menu
HTML Table Sizes
HTML Table Width
Adding the style attribute to the
element, allows to set the width of a table:
Example
table, th, td {
border:1px solid black;
border-collapse: collapse;
}
100% wide HTML Table
Firstname
Lastname
Age
Jill
Smith
50
Eve
Jackson
94
John
Doe
80
Output:
100% wide HTML Table
Firstname | Lastname | Age |
---|---|---|
Jill | Smith | 50 |
Eve | Jackson | 94 |
John | Doe | 80 |
HTML Table column width
To set the size of a specific column, add the style attribute on a <th> or <td> element:
Example
Firstname
Lastname
Age
Output:
Firstname | Lastname | Age |
---|