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

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
 
K

Karl Seguin

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
 
A

ALI-R

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>

================================
 
M

Mark Fitzpatrick

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
 
A

ALI-R

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,832
Latest member
GlennSmall

Latest Threads

Top