473,507 Members | 2,451 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can I force the form to extend to 90% of the body height?

<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






Oct 23 '08 #1
4 2473
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:

<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
nj********@hotmail.com
http://www.nathansokalski.com/

"AAaron123" <aa*******@roadrunner.comwrote in message
news:e$**************@TK2MSFTNGP05.phx.gbl...
<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






Oct 23 '08 #2

"Nathan Sokalski" <nj********@hotmail.comwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
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

>
<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
nj********@hotmail.com
http://www.nathansokalski.com/

"AAaron123" <aa*******@roadrunner.comwrote in message
news:e$**************@TK2MSFTNGP05.phx.gbl...
><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







Oct 23 '08 #3
the width and height set the size of the content area of a block element.
(inline element the values are ignored). if the value is specified as a
percent, then its a pecent of its parent's content area. note, margin, border
and scrollbars are outside the width. if the parent does not have an explicit
size, then the value is ignored.

try the following:

<html>
<body>
<div style="width:100%;height:100%;background-color:blue;" ></div>
<div style="width:100%;height:100%;background-color:yellow;" ></div>
</body>
</html>

you will see two boxes. each silghtly smaller than the screen size because
body has a margin by default.

-- bruce (sqlwork.com)
"AAaron123" wrote:
>
"Nathan Sokalski" <nj********@hotmail.comwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
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


<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
nj********@hotmail.com
http://www.nathansokalski.com/

"AAaron123" <aa*******@roadrunner.comwrote in message
news:e$**************@TK2MSFTNGP05.phx.gbl...
<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







Oct 23 '08 #4

"bruce barker" <br*********@discussions.microsoft.comwrote in message
news:FE**********************************@microsof t.com...
the width and height set the size of the content area of a block element.
(inline element the values are ignored). if the value is specified as a
percent, then its a pecent of its parent's content area. note, margin,
border
and scrollbars are outside the width. if the parent does not have an
explicit
size, then the value is ignored.
In my situation the tables parent, the form, had 100% which does not count
as an explicit size, so the table's 90% size was ignored. Right?

Maybe I should have stared with what I wanted to do.

My content pages each contains a div element containing html text.
Sometime a little and sometime a lot.
These end up oneat a time in one of the .master's table cells.
I'd like the content area to be a large as possible so if there is much text
and it could all fit on the screen it is not cramed into a small area with
scroll bars.
However, I don't want to explicitly make the area large because when there
is little text there will be scroll bars that scroll into black area.

Thanks for the info
>
try the following:

<html>
<body>
<div style="width:100%;height:100%;background-color:blue;" ></div>
<div style="width:100%;height:100%;background-color:yellow;" ></div>
</body>
</html>

you will see two boxes. each silghtly smaller than the screen size because
body has a margin by default.

-- bruce (sqlwork.com)
"AAaron123" wrote:
>>
"Nathan Sokalski" <nj********@hotmail.comwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
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

>
<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
nj********@hotmail.com
http://www.nathansokalski.com/

"AAaron123" <aa*******@roadrunner.comwrote in message
news:e$**************@TK2MSFTNGP05.phx.gbl...
<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








Oct 23 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
4414
by: Nomen Nescio | last post by:
can anyone be so kind as to look at http://www.mysolution.ws/HYPOCRITE.php and let me know why it isn't passing the form data to http://www.mysolution.ws/insertHYPOCRITES.php for the most...
7
3570
by: x muzuo | last post by:
Hi guys, I have got a prob of javascript form validation which just doesnt work with my ASP code. Can any one help me out please. Here is the code: {////<<head> <title>IIBO Submit Page</title>...
1
3729
by: IkBenHet | last post by:
Hello, I found this script to create a simple rich text form (http://programmabilities.com/xml/index.php?id=17): <html> <head> <title>Rich Text Editor</title> </head> <body>
2
2254
by: Clay Harryman | last post by:
I've found a script that will force-load index.html. It is below: (thanks to the authors!) <!-- Hide script from old browsers // This script copyright 1997, Tom Negrino and Dori Smith. // This...
4
2428
by: Tomasz Bak | last post by:
Hello, I have a simple problem: mark a list of defects on an image. I think the best way to do it is to select a single deffect, then take two coordinates of coursor form an image on a web...
1
3492
by: Sithlord999 | last post by:
Hello. I'm working on an email form on Dreamweaver and I'm looking for a PHP code to make it work. The form with some required fields would send the submitted information and two image attachments...
12
4657
by: daniel2335 | last post by:
This problem is everywhere! I have read all forums available, spent about 40+ hours on it and lost a bit of hair. I was going to explain what its ment to look like but I just realised removing the...
6
6117
by: ryanmhuc | last post by:
Is there a way with javascript to force firefox on a page to display the scrollbar even when the content does not extend outside the viewable error? Going from page to page where the scroll bar...
3
4285
by: blackrunner | last post by:
ERROR in my Query?! ERROR: Element GESCHLECHT is undefined in FORM. i think everything ok. Maby somebody can help me here Element GESCHLECHT is undefined in FORM. The error occurred...
0
7223
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7110
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7314
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7372
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7482
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5041
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1540
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
411
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.