By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,934 Members | 1,677 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,934 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Nov 19 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
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>

================================
"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:eE**************@tk2msftngp13.phx.gbl...
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

--
MY ASP.Net tutorials
http://www.openmymind.net/
"ALI-R" <ne****@microsoft.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
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


Nov 19 '05 #2

P: n/a
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

"ALI-R" <ne****@microsoft.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
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>

================================
"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:eE**************@tk2msftngp13.phx.gbl...
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

--
MY ASP.Net tutorials
http://www.openmymind.net/
"ALI-R" <ne****@microsoft.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
> 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
>
>



Nov 19 '05 #3

P: n/a
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

--
MY ASP.Net tutorials
http://www.openmymind.net/
"ALI-R" <ne****@microsoft.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
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

Nov 19 '05 #4

P: n/a
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>

================================
"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:eE**************@tk2msftngp13.phx.gbl...
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

--
MY ASP.Net tutorials
http://www.openmymind.net/
"ALI-R" <ne****@microsoft.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
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


Nov 19 '05 #5

P: n/a
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

"ALI-R" <ne****@microsoft.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
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>

================================
"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:eE**************@tk2msftngp13.phx.gbl...
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

--
MY ASP.Net tutorials
http://www.openmymind.net/
"ALI-R" <ne****@microsoft.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
> 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
>
>



Nov 19 '05 #6

P: n/a
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
"Mark Fitzpatrick" <ma******@fitzme.com> wrote in message
news:eS**************@TK2MSFTNGP15.phx.gbl...
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

"ALI-R" <ne****@microsoft.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
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>

================================
"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:eE**************@tk2msftngp13.phx.gbl...
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

--
MY ASP.Net tutorials
http://www.openmymind.net/
"ALI-R" <ne****@microsoft.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
> 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
>
>



Nov 19 '05 #7

P: n/a
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
"Mark Fitzpatrick" <ma******@fitzme.com> wrote in message
news:eS**************@TK2MSFTNGP15.phx.gbl...
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

"ALI-R" <ne****@microsoft.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
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>

================================
"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:eE**************@tk2msftngp13.phx.gbl...
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

--
MY ASP.Net tutorials
http://www.openmymind.net/
"ALI-R" <ne****@microsoft.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
> 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
>
>



Nov 19 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.