"Nathan Sokalski" <njsokalski@hotmail.comwrote in message
news:%23kdTg8MNJHA.2884@TK2MSFTNGP06.phx.gbl...
Quote:
First of all, using <br/tags to add space above and below elements is
very bad practice, since different browsers display them differently
(sometimes different sizes, etc.). I would suggest that you use CSS
margins instead. But I am also noticing that you have the height for your
form set to 100%, not 90%. If you are expecting the form to take up 90%
because of the 90% in the table, that will not work. When you use
percentages for height and width, it is that percentage of the container.
So your form will take up the entire height (except for the space from
your <br/tags) of the body, and the table will take up 90% of the form.
I would suggest the following:
Some switch in my head flipped and I wrote that I expected the form to be
90% instead of expecting the Table to be 90%.
I only used the <br/so that I could see the form's color.
Using your suggestion to use margins I used the following:
<body runat="server" id="Body1">
<form id="form2" runat="server" style="background-color:green; width:100%;
height: 100%; margin-top:20px; margin-bottom:20px;">
<asp:Table id="Table2" runat="server" Style="background-color:Yellow;
width: 100%; height: 90%; border:Maroon 9px
Ridge;margin-top:20px;margin-bottom:20px;">
I should say that this is a .master
If the content forms are small the table scrinks to fit and the form follows
suit leaving a bottom margin much larger than 20px.
If I don't use percentage I may pick a too small height for the content it
will cause my display to not use all of the availabe browser height and use
scroll bars when it did not have to. I'd have the same effect I just
described. If I pick a too large height I'll have scroll bars that scroll to
the unused area at the bottom.
Isn't that correct?
The fact that the content forms vary in height and I'd like the display to
adapt to them is the root of the problem.
I remove the two heights and it work the same. The bottom of the table moves
as I menu to different content but it looks OK.
Without percentages how would you do it?
Thanks
Quote:
>
<body runat="server" id="MainBody">
<form id="form1" runat="server" style="background-color:green; width:
100%; height: 90%; margin-top:10px;margin-bottom:10px;">
<asp:Table id="Table1" runat="server" Style="background-color:Yellow;
width: 100%; height: 100%; border:Maroon 9px Ridge;">
>
I have never been a fan of using percentages, but I'm also not a designer,
but I'm sure you know about some of the weird things browsers sometimes do
when rendering tables (they don't always like to cooperate with us as far
as heights and widths). Another thing you can try is to actually make the
height for both the form and table 100%, and since you are now specifying
margin-top and margin-bottom, you don't need to make the height any less
than 100%. Try some of this stuff, but the two key things I've mentioned
that you should take into account is how a height is calculated when a
percentage is used, and to use margins rather than <br/tags. Good Luck!
--
Nathan Sokalski
njsokalski@hotmail.com http://www.nathansokalski.com/
>
"AAaron123" <aaaron123@roadrunner.comwrote in message
news:e$n1KxLNJHA.2348@TK2MSFTNGP05.phx.gbl...
Quote:
><body runat="server" id="MainBody">
>>
><form id="form1" runat="server" style="background-color:green; width:
>100%; height: 100%">
>>
><br />
>>
>Table1" runat="server" Style="background-color:Yellow; width: 100%;
>height: 90%" BorderColor="Maroon"
>>
>BorderWidth="9px" BorderStyle="Ridge">
>>
>>
>>
>The body fills the IE window with it's color.
>>
>A little green shows at the top (because of the <br/>)
>>
>I also placed a <br/after the bottom of the table and a little green
>show there.
>>
>The yellow table fills the table between those two green areas.
>>
>>
>>
>The form's width does fill 100% of the body.
>>
>The two green areas show where the form is and the form does not cover
>90% of the body height!
>>
>>
>>
>That's my problem.
>>
>Can I force the form to extend to 90% of the body height some how?
>>
>>
>>
>Thanks
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>
>