This site is mobile accessible. Press the "Tap Here" button to use a smaller font-size.

Smartphone icons created by Freepik - Flaticon

5.3.1 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:

First name Last name Savings
Peter Griffin $100
Lois Griffin $150
Joe Swanson $300
Example 1
table {
  width: 100%;
}

th {
  height: 70px;
}

To create a table that should only span half the page, use width: 50%:

First name Last name Savings
Peter Griffin $100
Lois Griffin $150
Joe Swanson $300
Example 2
table {
  width: 50%;
}

th {
  height: 70px;
}