<!DOCTYPE html>
<html lang="en-US">
<head>
<style>
table, td, th{
border: 1px solid black;
}
table{
width: 200px;
}
</style>
</head>
<body>
<h1>CSS table-layout Property</h1>
<table>
<tr>
<th>Name</th>
<th>Age</th>
</tr>
<tr>
<td>Joseph Charles Buttler</td>
<td>28</td>
</tr>
<tr>
<td>Alex Tyson Carey</td>
<td>34</td>
</tr>
</table>
<button onclick="myFunction()">Click Me</button>
<script>
var x = document.getElementsByTagName("table")[0];
function myFunction(){
x.style.tableLayout = "fixed";
}
</script>
<p><strong>Note</strong>: Click on the button to change the 'table-layout' from 'auto' (default) to 'fixed'.</p> </body>
</html>