Click here to get back home

Form-Tag influences table layout

 HomeNewsGroups | Search | About
 comp.infosystems.www.authoring.html    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Form-Tag influences table layout Magnus Warker 12-18-2006
Get Chitika Premium
Posted by Magnus Warker on December 18, 2006, 12:23 pm
Please log in for more thread options


Hi group!

I know that HTML output is not as predictable as sometimes desired, but let
me ask a question.

The following HTML code produces a rectangle that covers the entire client
area of a web browser (table with width/height='100%').

Within this rectangle there is another rectangle, and it is desired that
this inner rectangle covers the entire area of the outer rectangle (another
table with width/height='100%').

This works as long as the inner table is not surrounded by a form tag.
Remove the form tags of the following code and it works. Leave them and the
inner rectangle's "height='100%' seems to be ignored.

This means that as soon as you insert the form tags, the height of the inner
form is redefined.

Are there any tricks to deal with this behavior? If you wonder for what it
would be good: There's a list of application data and a command bar (e. g.
'create', 'delete' etc.). The list should begin at the top, but the command
bar should always be at the bottom of the screen. I used to use the
"valign=bottom" tag for this, but this is useless, when the whole form does
not cover the whole height of the scene.

Thanks a lot,
Magnus

------

<html>
<body>

<table border='1' width='100%' height='100%'>
<tr>
<td align='center'>

<form action='/myservice' method='post'>

<table border='1' width='100%' height='100%'>
<tr>
<td align='center'>
XXX
</td>
</tr>
</table>

</form>

</td>
</tr>
</table>

</body>
</html>

Posted by Harlan Messinger on December 18, 2006, 12:19 pm
Please log in for more thread options


Magnus Warker wrote:
> Hi group!
>
> I know that HTML output is not as predictable as sometimes desired, but let
> me ask a question.
>
> The following HTML code produces a rectangle that covers the entire client
> area of a web browser (table with width/height='100%').
>
> Within this rectangle there is another rectangle, and it is desired that
> this inner rectangle covers the entire area of the outer rectangle (another
> table with width/height='100%').
>
> This works as long as the inner table is not surrounded by a form tag.
> Remove the form tags of the following code and it works. Leave them and the
> inner rectangle's "height='100%' seems to be ignored.

Ignored? Are you sure it isn't being set to 100% of the size of the
form, which itself has no specified size?
>
> This means that as soon as you insert the form tags, the height of the inner
> form is redefined.

Inner form? You can't have a form inside another form. You were talking
about an outer form before.
>
> Are there any tricks to deal with this behavior? If you wonder for what it
> would be good: There's a list of application data and a command bar (e. g.
> 'create', 'delete' etc.). The list should begin at the top, but the command
> bar should always be at the bottom of the screen. I used to use the
> "valign=bottom" tag for this, but this is useless, when the whole form does
> not cover the whole height of the scene.

Don't use the width and height attributes at all. Use CSS, and set width
and height to 100% for each of the successively nested elements.

Posted by Magnus Warker on December 18, 2006, 12:39 pm
Please log in for more thread options


Dear Harlan!

>> This works as long as the inner table is not surrounded by a form tag.
>> Remove the form tags of the following code and it works. Leave them and
>> the inner rectangle's "height='100%' seems to be ignored.
>
> Ignored? Are you sure it isn't being set to 100% of the size of the
> form, which itself has no specified size?

Interesting! Can I define the height of a form??? And: Why should the width
still be 100%?

>> This means that as soon as you insert the form tags, the height of the
>> inner form is redefined.
> Inner form? You can't have a form inside another form. You were talking
> about an outer form before.

Sorry, a mistake! I meant the inner table, not the inner form.

>> Are there any tricks to deal with this behavior? If you wonder for what
>> it would be good: There's a list of application data and a command bar
>> (e. g. 'create', 'delete' etc.). The list should begin at the top, but
>> the command bar should always be at the bottom of the screen. I used to
>> use the "valign=bottom" tag for this, but this is useless, when the whole
>> form does not cover the whole height of the scene.
>
> Don't use the width and height attributes at all. Use CSS, and set width
> and height to 100% for each of the successively nested elements.

So no chance with plain HTML?

Magnus

Posted by Harlan Messinger on December 18, 2006, 12:51 pm
Please log in for more thread options


Magnus Warker wrote:
> Dear Harlan!
>
>>> This works as long as the inner table is not surrounded by a form tag.
>>> Remove the form tags of the following code and it works. Leave them and
>>> the inner rectangle's "height='100%' seems to be ignored.
>> Ignored? Are you sure it isn't being set to 100% of the size of the
>> form, which itself has no specified size?
>
> Interesting! Can I define the height of a form??? And: Why should the width
> still be 100%?

Because the default width of block elements other than tables is
ordinarily 100%.

>
>>> This means that as soon as you insert the form tags, the height of the
>>> inner form is redefined.
>> Inner form? You can't have a form inside another form. You were talking
>> about an outer form before.
>
> Sorry, a mistake! I meant the inner table, not the inner form.
>
>>> Are there any tricks to deal with this behavior? If you wonder for what
>>> it would be good: There's a list of application data and a command bar
>>> (e. g. 'create', 'delete' etc.). The list should begin at the top, but
>>> the command bar should always be at the bottom of the screen. I used to
>>> use the "valign=bottom" tag for this, but this is useless, when the whole
>>> form does not cover the whole height of the scene.
>> Don't use the width and height attributes at all. Use CSS, and set width
>> and height to 100% for each of the successively nested elements.
>
> So no chance with plain HTML?

No, and you shouldn't use plain HTML to style the presentation anyway.
The HTML attributes that do exist for presentation are a legacy of a
turn down a wrong direction that was reversed years ago.

Posted by Magnus Warker on December 18, 2006, 1:12 pm
Please log in for more thread options


Hi Harlan!

>> Interesting! Can I define the height of a form??? And: Why should the
>> width still be 100%?
> Because the default width of block elements other than tables is
> ordinarily 100%.

What about the first question? Can I define the height of a form?

>> So no chance with plain HTML?
> No, and you shouldn't use plain HTML to style the presentation anyway.

How could I minimalistically set the height of a form with CSS?

> The HTML attributes that do exist for presentation are a legacy of a
> turn down a wrong direction that was reversed years ago.

Well, the reason why I would prefer non-CSS-layouts is some years ago.
Netscape had a bug that, when disabled JavaScript also disabled CSS. And JS
was disabled within that environment (e. g. filtered by a firewall).

Magnus

Similar ThreadsPosted
table layout September 28, 2006, 4:37 pm
HTML beautifiers and table layout October 17, 2004, 12:23 pm
table width layout problems in IE May 6, 2005, 7:51 pm
table-layout "fixed" gets buffered in IE? May 22, 2005, 2:51 pm
Table layout problem in Firefox/IE6 June 14, 2005, 8:42 am
Transition from table layout to CSS: Am I stupid? October 19, 2005, 12:25 pm
Extra Space in IE Table Layout June 16, 2006, 7:32 pm
convert a table to a May 19, 2008, 9:40 am
table-Layout:fixed; ok for IE but not for FireFox June 11, 2008, 5:22 am
nested table and site layout problems June 12, 2006, 3:52 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap