CSS Table Size
Posted: Fri Oct 27, 2023 8:22 am
CSS Table Size
Table Width and Height
The width and height of a table are defined by the width and height properties.
The example below sets the width of the table to 100%, and the height of the
<th> elements to 70px:
Firstname
Lastname
Savings
Peter
Griffin
$100
Lois
Griffin
$150
Joe
Swanson
$300
Example
table
{
width: 100%;
}
th
{
height: 70px;
}
Try it Yourself »
To create a table that should only span half the page, use width: 50%:
Firstname
Lastname
Savings
Peter
Griffin
$100
Lois
Griffin
$150
Joe
Swanson
$300
Example
table
{
width: 50%;
}
Try it Yourself »
★
+1
Reference: https://www.w3schools.com/css/css_table_size.asp
Table Width and Height
The width and height of a table are defined by the width and height properties.
The example below sets the width of the table to 100%, and the height of the
<th> elements to 70px:
Firstname
Lastname
Savings
Peter
Griffin
$100
Lois
Griffin
$150
Joe
Swanson
$300
Example
table
{
width: 100%;
}
th
{
height: 70px;
}
Try it Yourself »
To create a table that should only span half the page, use width: 50%:
Firstname
Lastname
Savings
Peter
Griffin
$100
Lois
Griffin
$150
Joe
Swanson
$300
Example
table
{
width: 50%;
}
Try it Yourself »
★
+1
Reference: https://www.w3schools.com/css/css_table_size.asp