S
steve_barker333
Hi guys,
I'm just in the process of converting a site I'm writing from ASP.NET
1.1 to ASP.NET 2.0. Of course, there are lots of new features that are
going to save me a lot of time, but at the moment I'm wasting a lot of
time trying to work out why a simple html table that worked fine in 1.1
doesn't work in 2.0.
Here is the html for the table as it appeared in my 1.1 page (it's very
simple):
====================
<TABLE id="tblMain" style="Z-INDEX: 101; LEFT: 0px; WIDTH: 100%;
POSITION: absolute; TOP: 0px; HEIGHT: 100%"
cellSpacing="1" cellPadding="1" width="300" border="0">
<TR height="40%">
<TD width="100%"></TD>
</TR>
<TR>
<TD width="100%">
<DIV style="DISPLAY: inline; FONT-WEIGHT: bold; VERTICAL-ALIGN:
baseline; WIDTH: 100%; COLOR: blue; FONT-STYLE: italic; HEIGHT: 100%;
TEXT-ALIGN: center">Some text</DIV>
</TD>
</TR>
<TR height="40%">
<TD width="100%"></TD>
</TR>
</TABLE>
====================
In 1.1, I had this table as part of an aspx page, and all was fine. The
text "Some text" appears right in the middle of the screen. It should
be noted that the page included the following body tag: <body
MS_POSITIONING="GridLayout">.
Now, when I put the same table into a version 2.0 page, in design view,
the text appears on the left of the screen, vertically centred. OK I
thought; let's make sure the text is horizontally centred by amending
the html thus:
====================
<TABLE id="tblMain" style="Z-INDEX: 101; LEFT: 0px; WIDTH: 100%;
POSITION: absolute; TOP: 0px; HEIGHT: 100%"
cellSpacing="1" cellPadding="1" width="300" border="0">
<TR height="40%">
<TD width="100%"></TD>
</TR>
<TR>
<TD width="100%" align="center">
<DIV style="DISPLAY: inline; FONT-WEIGHT: bold; WIDTH: 100%; COLOR:
blue; FONT-STYLE: italic; HEIGHT: 100%">Some text</DIV>
</TD>
</TR>
<TR height="40%">
<TD width="100%"></TD>
</TR>
</TABLE>
====================
Looks good in design mode.... but when I run the page, the text appears
at the top of the screen in the centre. How do I get the text to appear
slap band in the middle? Why is it doing this and what have I missed?!
Any help would be greatly appreciated. I'm still quite new to ASP.NET,
so please don't assume anything in your reply!
Thanks in advance!
Steve.
I'm just in the process of converting a site I'm writing from ASP.NET
1.1 to ASP.NET 2.0. Of course, there are lots of new features that are
going to save me a lot of time, but at the moment I'm wasting a lot of
time trying to work out why a simple html table that worked fine in 1.1
doesn't work in 2.0.
Here is the html for the table as it appeared in my 1.1 page (it's very
simple):
====================
<TABLE id="tblMain" style="Z-INDEX: 101; LEFT: 0px; WIDTH: 100%;
POSITION: absolute; TOP: 0px; HEIGHT: 100%"
cellSpacing="1" cellPadding="1" width="300" border="0">
<TR height="40%">
<TD width="100%"></TD>
</TR>
<TR>
<TD width="100%">
<DIV style="DISPLAY: inline; FONT-WEIGHT: bold; VERTICAL-ALIGN:
baseline; WIDTH: 100%; COLOR: blue; FONT-STYLE: italic; HEIGHT: 100%;
TEXT-ALIGN: center">Some text</DIV>
</TD>
</TR>
<TR height="40%">
<TD width="100%"></TD>
</TR>
</TABLE>
====================
In 1.1, I had this table as part of an aspx page, and all was fine. The
text "Some text" appears right in the middle of the screen. It should
be noted that the page included the following body tag: <body
MS_POSITIONING="GridLayout">.
Now, when I put the same table into a version 2.0 page, in design view,
the text appears on the left of the screen, vertically centred. OK I
thought; let's make sure the text is horizontally centred by amending
the html thus:
====================
<TABLE id="tblMain" style="Z-INDEX: 101; LEFT: 0px; WIDTH: 100%;
POSITION: absolute; TOP: 0px; HEIGHT: 100%"
cellSpacing="1" cellPadding="1" width="300" border="0">
<TR height="40%">
<TD width="100%"></TD>
</TR>
<TR>
<TD width="100%" align="center">
<DIV style="DISPLAY: inline; FONT-WEIGHT: bold; WIDTH: 100%; COLOR:
blue; FONT-STYLE: italic; HEIGHT: 100%">Some text</DIV>
</TD>
</TR>
<TR height="40%">
<TD width="100%"></TD>
</TR>
</TABLE>
====================
Looks good in design mode.... but when I run the page, the text appears
at the top of the screen in the centre. How do I get the text to appear
slap band in the middle? Why is it doing this and what have I missed?!
Any help would be greatly appreciated. I'm still quite new to ASP.NET,
so please don't assume anything in your reply!
Thanks in advance!
Steve.