วิธีการทำ Table 2 ให้อยู่ตรงกลางง่ายๆ ปรับ style ของ table 2 ให้
margin-left:auto;
margin-right:auto;

 

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">

        #tb1 {
            width:100%;
            background-color:ActiveBorder;
        }
        #tb2 {
            width:500px;
            background-color:#CCFFCC;
            margin-left:auto;
            margin-right:auto;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>

     <table id="tb1"><tr><td>
         Table 1
         <table id="tb2"><tr><td>Table 2</td></tr></table>
                </td></tr></table>
    </div>
    </form>
</body>
</html>

 

By admin

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.