Tôi đang sử dụng mã sau đây. Làm thế nào để đặt bảng này ở giữa trang bằng cách sử dụng CSS?Làm thế nào để đặt bảng ở giữa trang bằng cách sử dụng CSS?
<html>
<head>
<link rel="stylesheet" type="text/css" href="styles.css" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>The Main Page</title>
</head>
<body>
<table>
<tr>
<td><button class="lightSquare"></button></td>
<td><button class="darkSquare"></button></td>
<td><button class="lightSquare"></button></td>
<td><button class="darkSquare"></button></td>
<td><button class="lightSquare"></button></td>
<td><button class="darkSquare"></button></td>
<td><button class="lightSquare"></button></td>
<td><button class="darkSquare"></button></td>
</tr>
</table>
</body>
</html>
Duplicate của nhiều câu hỏi khác ví dụ http://stackoverflow.com/questions/2281087/center-a-div-in-css – jacktheripper
nằm ngang ở giữa? theo chiều dọc được đặt ở giữa? cả hai? –
Cả hai chiều ngang và theo chiều dọc – CodeBlue