首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

用MARGIN: auto干居中为什么不灵

2011-12-22 
用MARGIN: auto做居中为什么不灵?我想使整个table相对pan2做居中,代码如下asp:Panelid Pan style LE

用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 ",然后生成画面看看

热点排行