I coded a 2-rows/2-column HTML table as follows:
<!DOCTYPE html>
<html lang="en">
<head>
<style>
table, th, td {
border: 2px solid black;
border-collapse: collapse;
align-content: center;
text-align: center;
}
th, td {
padding: 10px;
}
</style>
</head>
<body>
<table>
<tr>
<th>Header Column 1</th>
<th>Header Column 1</th>
</tr>
<tr>
<td>Data Column 1</td>
<td>Data Column 2</td>
</tr>
</table>
</body>
</html>
When the browser window is equal or less than the width of both columns - all looks nice. However, when the browser window is stretched wider - the table expands with it, kind of creating additional column after the last column coded until the end of the width of the browser window. I tried to Google why is that and how to prevent the table to expand beyond the las column with the browser - I could not find any relevant HTML/CSS attribute. Any suggestions?