日期:2014-05-18  浏览次数:20489 次

用MARGIN: auto做居中为什么不灵?
我想使整个table相对pan2做居中,代码如下

<asp:Panel   id= "Pan "   style= "LEFT:   208px;   POSITION:   absolute;   TOP:   8px "   runat= "server "   BackColor= "WhiteSmoke "   Width= "560px ">
    <asp:Panel   id= "Pan1 "   runat= "server "> ... </asp:Panel>
    <asp:Panel   id= "Pan2 "   runat= "server ">
        <asp:Table   id= "Tab_Class "   style= "MARGIN:   auto "   runat= "server "   Width= "520 "   GridLines= "Horizontal "   CellPadding= "0 "   CellSpacing= "0 ">
        </asp:Table>
    </asp:Panel>
</asp:Panel>

结果不起作用,问题在哪里呢?

------解决方案--------------------
style换成horizontalalign= "Center ",然后生成画面看看