1) Setting horizontal alignment to auto in CSS
margin-left: auto; margin-right: auto;
2) Get vertical alignment to the center of the page add the following to css
html, body { width: 100%; }
For example:
<html> <head> <meta charset="ISO-8859-1"> <style type="text/css"> table.center { margin-left: auto; margin-right: auto; } html, body { width: 100%; } </style> <title>Table with css</title> </head> <body> <table class="center"> <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>
Gopal00005 Apr 15 '15 at 6:19 2015-04-15 06:19
source share