Center Html table inside div using center tag

Last Reply 5 months ago By dharmendr

Posted 5 months ago

I have one div which contain one table ,but i want to place this table at the center of div,so whenever i am potback my page it will show me in center.I have tried below code.

<div style="margin: 0 auto">
     <table style="align-content: center" border="0" cellpadding="0" cellspacing="0">
            <td style="text-align: right">Id:
You are viewing reply posted by: dharmendr 5 months ago.
Posted 5 months ago

Hi babuk,

You can use center tag to allign the table at center inside the div.

Refer the below sample html.

<html xmlns="">
<head runat="server">
    <style type="text/css">
            font-family: Arial;
            font-size: 10pt;
            border: 1px solid #ccc;
        table th
            background-color: #F7F7F7;
            color: #333;
            font-weight: bold;
        table th, table td
            padding: 5px;
            border-color: #ccc;
    <div style="margin: 0 auto">
            <table border="0" cellpadding="0" cellspacing="0">
                    <td style="text-align: right">


I agree, here is the link: