To center align a DIV or a table, use “margin” property in CSS. Look at the example HTML file below.

<html>
</head>
<title>DIV center align demo</title>
<style>
.calign { margin: 0 auto; }
div { width: 60%; background-color: #fff; }
body { background-color: #333;}
</style>
</head>
<body>
<div class="calign">This is my DIV aligned in center</div>
</body>
</html>

In the avobe example HTML file, “margin: 0 auto;” makes the DIV element to align in center.