Align="Center" dosen't work in the Table on my asp.net page

  • Thread starter Thread starter ALI-R
  • Start date Start date
A

ALI-R

Hi All,

I have two user controls (header and footer) ,,which I've placed in an HTML
Table in a page.I set the **align="center"** in the table and the table
still is on the left side of the page .How can I get the whole page(Table
and its user controls) aligned in the center of my page?

Thanks for your time in advance.
Ali
 
Ali:
Can you provide more examples?

if I do
<table align="Center" border="1" width="50%">
<tr><td>1</td><td>2</td></tr>
</table>

the table appears in the middle in both IE and firefox.

Karl
 
Thanks for your quick reply,
here is the code
<form id="Form1" method="post" runat="server">
<TABLE id="Table1" style="Z-INDEX: 101; LEFT: 8px; POSITION: absolute;
TOP: 12px" cellSpacing="1"
cellPadding="1" align="center" width="300" border="1">
<TR>
<TD>UserControl1</TD>
</TR>
<TR>
<TD>Body</TD>
</TR>
<TR>
<TD>UserControl2</TD>
</TR>
</TABLE>
</form>

================================
 
Ali,
It's probably the absolute positioning. Look at the style attribute,
it's set to put the table 8 pixels from the left margin. Setting the
alignment probably won't work as it should be over-ridden by the css
positioning. Try getting rid of the absolute positioning and see if that
helps. If you're using VS.Net, you may want to change from Grid Layout to
Flow Layout for the page. The positioning that the Grid Layout automatically
puts in can be a pain sometimes.

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage
 
Mark,
Thanks for yuor help.Now it's working:
The page's layout had been already set to **Flow Layout** so it didn't
help,but when I got rid of absolute positioning ,it worked and now the table
is in the center of the page.

Thanks Mark and Karl,
Ali
 
Back
Top