页面是在800、600模式下设计的,我在1024、768下想让它居中,可是我把它们放到TABLE里面,之间差距就太大了,有什么办法可以解决?代码如下:
<form id="Form1" method="post" runat="server">
<FONT face="宋体">
<asp:panel id="Panel1" style="Z-INDEX: 101; LEFT: 8px; POSITION: absolute; TOP: 8px" runat="server" Width="778px" Height="145px"><P>
<uc1:top id="Top1" runat="server"></uc1:top></P></asp:panel>
<asp:panel id="Panel2" style="Z-INDEX: 102; LEFT: 8px; POSITION: absolute; TOP: 152px" runat="server" Width="195px" Height="442px"><P>
<uc1:left1 id="Left11" runat="server"></uc1:left1></P></asp:panel>
<asp:panel id="Panel3" style="Z-INDEX: 103; LEFT: 203px; POSITION: absolute; TOP: 152px" runat="server" Width="384px" Height="442px">
<uc1:middle id="Middle1" runat="server"></uc1:middle></asp:panel>
<asp:panel id="Panel4" style="Z-INDEX: 104; LEFT: 589px; POSITION: absolute; TOP: 153px" runat="server" Width="195px" Height="442px">
<uc1:right id="Right1" runat="server"></uc1:right></asp:panel>
<asp:panel id="Panel5" style="Z-INDEX: 105; LEFT: 8px; POSITION: absolute; TOP: 595px" runat="server" Width="250px" Height="243px">
<uc1:left2 id="Left21" runat="server"></uc1:left2></asp:panel>
<asp:panel id="Panel6" style="Z-INDEX: 106; LEFT: 273px; POSITION: absolute; TOP: 598px" runat="server" Width="244px" Height="245px">
<uc1:zj id="Zj1" runat="server"></uc1:zj></asp:panel>
<asp:panel id="Panel7" style="Z-INDEX: 107; LEFT: 516px; POSITION: absolute; TOP: 600px" runat="server"Width="279px" Height="240px">
<uc1:right2 id="Right21" runat="server"></uc1:right2></asp:panel>
<asp:panel id="Panel8" style="Z-INDEX: 108; LEFT: 8px; POSITION: absolute; TOP: 840px" runat="server" Width="778px" Height="122px">
<uc1:bottom id="Bottom1" runat="server"></uc1:bottom></asp:panel></FONT></form>
谢谢大家!!!!!!!!

解决方案 »

  1.   

    我建议你删除style属性,然后用FrontPage2003重新编辑一下即好用了
      

  2.   

    首先,将页面属性改为:FlowLayout表格宽度:760/780px<table align="center" width="780">xxxx</table>
      

  3.   

    在需要居中的内容前后加上:<center></center>(不提倡这种写法,最好用table)
      

  4.   

    以后做界面建议先放表格再加控件就好
    <form id="Form1" method="post" runat="server">
    <table align="center" cellspacing="0">
    <tr height="145">
    <td width="778">
    <asp:panel id="Panel1" runat="server" Width="778px" Height="145px">
    <UC1:TOP id="Top1" runat="server"></UC1:TOP>
    </asp:panel></td>
    </tr>
    <tr height="442">
    <td width="778"><table cellspacing="0">
    <tr>
    <td>
    <asp:panel id="Panel2" runat="server" Width="195px" Height="442px">
    <UC1:LEFT1 id="Left11" runat="server"></UC1:LEFT1>
    </asp:panel></td>
    <td>
    <asp:panel id="Panel3" runat="server" Width="384px" Height="442px">
    <UC1:MIDDLE id="Middle1" runat="server"></UC1:MIDDLE>
    </asp:panel></td>
    <td>
    <asp:panel id="Panel4" runat="server" Width="195px" Height="442px">
    <UC1:RIGHT id="Right1" runat="server"></UC1:RIGHT>
    </asp:panel></td>
    </tr>
    </table>
    </td>
    </tr>
    <tr height="243">
    <td width="778"><table cellspacing="0">
    <tr>
    <td>
    <asp:panel id="Panel5" runat="server" Width="250px" Height="243px">
    <UC1:LEFT2 id="Left21" runat="server"></UC1:LEFT2>
    </asp:panel></td>
    <td>
    <asp:panel id="Panel6" runat="server" Width="244px" Height="245px">
    <UC1:ZJ id="Zj1" runat="server"></UC1:ZJ>
    </asp:panel></td>
    <td>
    <asp:panel id="Panel7" runat="server" Width="279px" Height="240px">
    <UC1:RIGHT2 id="Right21" runat="server"></UC1:RIGHT2>
    </asp:panel></td>
    </tr>
    </table>
    </td>
    </tr>
    <tr height="122">
    <td width="778">
    <asp:panel id="Panel8" runat="server" Width="778px" Height="122px">
    <UC1:BOTTOM id="Bottom1" runat="server"></UC1:BOTTOM>
    </asp:panel></td>
    </tr>
    </table>
    </form>
      

  5.   

    曾试图删除style,位置就乱了
    TO: sean168(曾是牧羊人) 
    我把PAGELayout设置为FlowLayout
    然后<table align="center" width="780">〈TD〉xxxx〈/TD〉</table>
    这样在1024、768下根本看不出效果,还是不能居中
      

  6.   

    http://community.csdn.net/Expert/topic/3524/3524886.xml?temp=.3290216
      

  7.   

    在table标记中全加
    cellpadding="0" cellspacing="0"
    就行
      

  8.   

    如果已经在vs中创建好表格,再删除style肯定会乱,这时候就需要在FrontPage2003中编辑,另外创建一个表格,再删除原有的表格中style属性,用拖曳的方法把相应的控件拖放到新表格的指定位置即可,这样决不会乱,以后就和编辑word 一样,爱怎么编辑就怎么编辑
      

  9.   

    VS.net中页面的先加一个table(HTML界面中)
    然后在设计界面中拖入控件就不会自动加style
      

  10.   

    welshem(天堂客) :
    我都加cellspacing="0",可还是接不上,我没法发图让你看
    甲克虫:你说的那种方法,我把窗体嵌到表里,发现只能让PANEL1居中,其它的还是没效果
    昨天晚上搞了半天,今天一直搞它就没搞定,郁闷,还有别的方法吗?