Form-Tag影响表格布局 [英] Form-Tag influences table layout

查看:40
本文介绍了Form-Tag影响表格布局的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨组!


我知道HTML输出不像有时候想象的那样可预测,但是让我问一个问题。


以下HTML代码生成一个矩形,覆盖整个客户端

浏览器区域(宽度/高度='''100%''的表格)。 />

在这个矩形内有另一个矩形,希望

这个内部矩形覆盖外部矩形的整个区域(另一个

表格,宽度/高度='''100%'')。


只要内表不被表格标签包围,这就有效。

删除以下代码的表单标签,它可以工作。保留它们并且

内部矩形''" height ='''100%'似乎被忽略。


这意味着尽快你插入表格标签,内部

表格的高度被重新定义。


是否有任何技巧来处理这种行为?如果你想知道它是什么,那么b $ b就是好的:有一个应用程序数据列表和一个命令栏(例如

''create'',''delete' '等)。列表应从顶部开始,但命令

bar应始终位于屏幕底部。我曾经使用过

" valign = bottom"标签为这,但这是没用的,当整个表格确实

不能覆盖场景的整个高度。


非常感谢,

Magnus


------


< html>

<正文>


< 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>

解决方案

Magnus Warker写道:


你好组!


我知道HTML输出不像有时候想象的那样可预测,但是让我们来看看

我问一个问题。


以下HTML代码生成一个矩形,覆盖整个客户端

浏览器区域(宽度/高度的表格) ='''100%'')。


在这个矩形内还有另一个矩形,希望

这个内部矩形覆盖整个区域外部矩形(另一个

表,宽度/高度='''100%'')。


只要内部表未被包围,这就可以工作通过表单标签。

删除以下代码的表单标签,它可以正常工作。保留它们并且

内部矩形''" height ='''100%''似乎被忽略了。



忽略?你确定它没有设置为

表格的100%,它本身没有指定的大小吗?


>

这意味着只要你插入表格标签,内部的高度就可以了
表格被重新定义。



内部形式?你不能在另一个表格中有一个表格。你以前在谈论一个外形,你正在谈论



>

有什么技巧可以解决这个问题吗?如果你想知道它是什么,那么b $ b就是好的:有一个应用程序数据列表和一个命令栏(例如

''create'',''delete' '等)。列表应从顶部开始,但命令

bar应始终位于屏幕底部。我曾经使用过

" valign = bottom"标签为此,但这是没用的,当整个表格确实

不覆盖整个场景的高度。



根本不要使用width和height属性。使用CSS,并为每个连续嵌套的元素设置宽度

和高度为100%。


亲爱的哈伦!
< blockquote class =post_quotes>


>只要内部表格未被表格标签包围,这就有效。
删除以下代码的表格标签,有用。留下它们并且内部矩形'''height ='''100%''似乎被忽略了。



忽略?你确定它没有设置为

表格的100%,它本身没有指定的大小吗?



有趣!我可以定义表格的高度吗???并且:为什么宽度

仍然是100%?


>这意味着尽快当您插入表单标签时,
内部表单的高度将重新定义。



内部形式?你不能在另一个表格中有一个表格。你以前在谈论一个外形,你正在谈论




对不起,错了!我的意思是内部表格,而不是内部表格。


>是否有任何技巧来处理这种行为?如果你想知道什么是好的:有一个应用程序数据列表和一个命令栏
(例如''create'',''delete''等)。列表应从顶部开始,但命令栏应始终位于屏幕的底部。我以前用
使用valign = bottom标签为此,但这是没用的,当整个
形式不覆盖整个场景的高度。



根本不要使用width和height属性。使用CSS,并为每个连续嵌套的元素设置宽度

和高度为100%。



所以没有机会使用纯HTML?


Magnus


Magnus Warker写道:


亲爱的哈伦!


> >只要内部表未被表单标记包围,这就可以工作。
删除以下代码的表单标记,它可以正常工作。留下它们并且内部矩形'''height ='''100%''似乎被忽略了。


忽略?你确定它没有被设置为
形式的100%,它本身没有指定的大小吗?



很有意思!我可以定义表格的高度吗???并且:为什么宽度

仍然是100%?



因为除了表格之外的块元素的默认宽度是

通常为100%。


>


>>这意味着只要插入表单标签,
内部表单的高度被重新定义。


内部表格?你不能在另一个表格中有一个表格。你以前说过关于外形的说法。



对不起,错了!我的意思是内表,而不是内部表格。


>>是否有任何技巧来处理这种行为?如果你想知道什么是好的:有一个应用程序数据列表和一个命令栏
(例如''create'',''delete''等)。列表应从顶部开始,但命令栏应始终位于屏幕的底部。我以前用
使用valign = bottom标签为此,但这是没用的,当整个
形式不覆盖整个场景的高度。


根本不要使用width和height属性。使用CSS,并为每个连续嵌套的元素设置宽度
和高度为100%。



所以没有纯HTML的机会?



否,你不应该使用普通的HTML来设置演示文稿的样式。

用于演示的HTML属性是一个传统的

拒绝了多年前逆转的错误方向。


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>

解决方案

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.


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


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.


这篇关于Form-Tag影响表格布局的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆