页面是在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>
谢谢大家!!!!!!!!
<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>
谢谢大家!!!!!!!!
<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>
TO: sean168(曾是牧羊人)
我把PAGELayout设置为FlowLayout
然后<table align="center" width="780">〈TD〉xxxx〈/TD〉</table>
这样在1024、768下根本看不出效果,还是不能居中
cellpadding="0" cellspacing="0"
就行
然后在设计界面中拖入控件就不会自动加style
我都加cellspacing="0",可还是接不上,我没法发图让你看
甲克虫:你说的那种方法,我把窗体嵌到表里,发现只能让PANEL1居中,其它的还是没效果
昨天晚上搞了半天,今天一直搞它就没搞定,郁闷,还有别的方法吗?