Set the width

Report a typo

Specify the total width of the table as 50% and set the width of the third column to 20% in the below code.

Write HTML and CSS code
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Column width</title>
</head>
<body>
<table>
<thead>
<tr>
<th>Cell 1.1</th>
<th>Cell 1.2</th>
<th class="third">Cell 1.3</th>
</tr>
</thead>

<tbody>
<tr>
<td>Cell 2.1</td>
<td>Cell 2.2</td>
<td>Cell 2.3</td>
</tr>

<tr>
<td>Cell 3.1</td>
<td>Cell 3.2</td>
<td>Cell 3.3</td>
</tr>
</tbody>
</table>
</body>
</html>
Completed 2 of 3
Set the size of the table to 50%
The code is valid

Create a free account to access the full topic