TD:插入冗长数据时col的宽度变得混乱。为什么? [英] TD : Width of col goes haywire when a lengthy data is inserted. Why?

查看:79
本文介绍了TD:插入冗长数据时col的宽度变得混乱。为什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨伙计们。


一个过早而冗余的问题可能......但我有一个TABLE

问题。


这几乎就像我想要实现的那样。


----------------------- ------------------

| | | | |

| Col1 | Col2 | Col3 | Col4 |

| | | | |

-----------------------------------------

| | |

| | Colspan = 3 |

| | |

-----------------------------------------


这就是我一直在尝试的...


< HTML>

< HEAD> ;< / HEAD>

< BODY>

< TABLE BORDER = 1 ALIGN =" CENTER" CELLSPACING = QUOT; 0" WIDTH =" 744px" STYLE ="">


< TR>

< TD WIDTH =" 372px" ALIGN = CENTER VALIGN = MIDDLE STYLE ="">

货物的描述< / TD>

< TD WIDTH =" 126px" ALIGN = CENTER VALIGN = MIDDLE STYLE =">

数量(编号)< / TD>

< TD WIDTH =" 126px" ALIGN = CENTER VALIGN = MIDDLE STYLE ="">费率(Rs。)< / TD>

< TD WIDTH =" 119px" ALIGN = CENTER VALIGN = MIDDLE STYLE ="">

金额(Rs。)< / TD>

< / TR>


< TR>

< TD HEIGHT =" 200px" COLSPAN = 1 ALIGN = LEFT VALIGN = TOP

STYLE =" word-wrap:normal;">这是一个html测试,看看当输入大文本时为什么列的宽度会变得混乱...< / TD>

< TD HEIGHT =" ; 200像素" COLSPAN = 3 ALIGN = LEFT VALIGN = MIDDLE

STYLE =" word-wrap:normal;">

这是一个html测试,看看为什么宽度为当输入大文本时,列变得混乱

...< / TD>

< / TR>


< / TABLE>

< / BODY>

< / HTML>

对,现在我的问题..如果是正文在第二行是冗长的,

它相应地包装,但是细胞的宽度会折腾。

为什么会这样?


我浏览了一些早期的帖子,他们碰巧说

表示< TD>的WIDTH attr了。不支持。

html是通过外部应用程序生成/呈现的;因此嵌套

的表是不可能的....

这基本上是我们的内部网,所有系统都使用IE 5.5+

任何有答案的人?我希望有人会有责任。


问候,

Rithish。

解决方案

ri*****@dacafe.com (Rithish)写道:

嗨伙计。

一个过早而多余的问题可能......但我有一个TABLE
问题。

这几乎就像我想要实现的那样。

-----------------------------------------
| | | | |
| Col1 | Col2 | Col3 | Col4 |
| | | | |
-----------------------------------------
| | |
| | Colspan = 3 |
| | |
-----------------------------------------

这就是我一直在尝试的......

< HTML>
< HEAD>< / HEAD>
< BODY>

[第一行:]< TR>
< TD WIDTH =" 372px" ALIGN = CENTER VALIGN = MIDDLE STYLE ="">
商品< / TD>的描述
....


[第二行:]< TR>
< TD HEIGHT =" 200px" COLSPAN = 1 ALIGN = LEFT VALIGN = TOP
STYLE =" word-wrap:normal;">这是一个html测试,看看当输入大文本时为什么列的宽度会变得混乱...< / TD>



....


首先:如果在第一行中你告诉浏览器表'的第一个

列是372像素宽,然后在第二行你告诉它是第一列是200像素宽,你有什么期望*可怜的

浏览器要做什么?


第二:HTML宽度属性在HTML 4.01过渡时有效

但不严格。与所有布局特征一样,建议使用CSS而不是HTML属性。
练习是使用CSS而不是HTML属性。对于

对齐,边框和单元格间距也是如此。


第三:HTML宽度属性被视为最小宽度,而不是最大值
。如果内容对于规定的宽度来说太大,实际的宽度将大于规定的宽度。


-

Harlan Messinger

从我的电子邮件地址中删除第一个点。

Veuillez?ter le premier point de mon adresse de courriel。


Harlan Messinger写道:

ri ***** @ dacafe.com (Rithish)写道:

嗨伙计。

一个过早而多余的问题可能......但我有一个TABLE
问题。

这几乎就像我想要的那样。

-------------- ---------------------------
| | | | |
| Col1 | Col2 | Col3 | Col4 |
| | | | |
-----------------------------------------
| | |
| | Colspan = 3 |
| | |
-----------------------------------------

这就是我一直在尝试的......

< HTML>
< HEAD>< / HEAD>
< BODY>


[第一行:]

< TR>
< TD WIDTH =" 372px" ALIGN = CENTER VALIGN = MIDDLE STYLE ="">商品描述
商品< / TD>





[第二行:]

< TR>
< TD HEIGHT =" 200px" COLSPAN = 1 ALIGN = LEFT VALIGN = TOP
STYLE =" word-wrap:normal;">这是一个html测试,看看当输入大文本时为什么列的宽度会变得混乱...< / TD>



...

首先:如果在第一行中你告诉浏览器该表的第一列
是372像素宽,然后在第二行你告诉它
第一列是200像素宽,你期望什么*可怜的浏览器做什么?




它的高度是200px,而不是宽度,但你的观点仍然是

有效。给定一个固定的矩形大小和任意数量的文本,

浏览器可以做什么?


-

马克。




" Mark Tranchant" <毫安** @ tranchant.plus.com>在消息中写道

新闻:_S ***************** @ stones.force9.net ...

Harlan Messinger写道:

ri*****@dacafe.com (Rithish)写道:

嗨伙计。

一个过早而多余的问题可能......但我有一个TABLE
问题。

这几乎就像我想要实现的那样。

------------------------ -----------------
| | | | |
| Col1 | Col2 | Col3 | Col4 |
| | | | |
-----------------------------------------
| | |
| | Colspan = 3 |
| | |
-----------------------------------------

这就是我一直在尝试的......

< HTML>
< HEAD>< / HEAD>
< BODY>
[第一行:]

< TR>
< TD WIDTH =" 372px" ALIGN = CENTER VALIGN = MIDDLE STYLE ="">商品描述
商品< / TD>





[第二行:]

< TR>
< TD HEIGHT =" 200px" COLSPAN = 1 ALIGN = LEFT VALIGN = TOP
STYLE =" word-wrap:normal;">这是一个html测试,看看当输入大文本时为什么列的宽度会变得混乱...< / TD>



...

首先:如果在第一行中你告诉浏览器该表的第一列
是372像素宽,然后在第二行你告诉它
第一列是200像素宽,你期望什么*可怜的浏览器做什么?



它的高度是200px,而不是宽度,




哎呀。什么是尴尬的图释?

但你的观点仍然有效。给定一个固定的矩形大小和任意数量的文本,浏览器可以做什么?




Hi folks.

A premature and redundant question maybe... But I have a TABLE
problem.

This is almost something like what I want to acheive.

-----------------------------------------
| | | | |
| Col1 | Col2 | Col3 | Col4 |
| | | | |
-----------------------------------------
| | |
| | Colspan=3 |
| | |
-----------------------------------------

And this is what I have been trying...

<HTML>
<HEAD></HEAD>
<BODY>
<TABLE BORDER=1 ALIGN="CENTER" CELLSPACING="0" WIDTH="744px" STYLE="">

<TR>
<TD WIDTH="372px" ALIGN=CENTER VALIGN=MIDDLE STYLE=""> Description of
Goods</TD>
<TD WIDTH="126px" ALIGN=CENTER VALIGN=MIDDLE STYLE="">
Quantity(Nos.)</TD>
<TD WIDTH="126px" ALIGN=CENTER VALIGN=MIDDLE STYLE=""> Rate(Rs.)</TD>
<TD WIDTH="119px" ALIGN=CENTER VALIGN=MIDDLE STYLE="">
Amount(Rs.)</TD>
</TR>

<TR>
<TD HEIGHT="200px" COLSPAN=1 ALIGN=LEFT VALIGN=TOP
STYLE="word-wrap:normal;"> This is an html test to see why the widths
of the columns go haywire when large text is input... </TD>
<TD HEIGHT="200px" COLSPAN=3 ALIGN=LEFT VALIGN=MIDDLE
STYLE="word-wrap:normal;">
This is an html test to see why the widths of the columns go haywire
when large text is input... </TD>
</TR>

</TABLE>
</BODY>
</HTML>
Right, now to my problem.. If the text in the second row is lengthy,
it wraps accordingly, however the widths of the cells go for a toss.
Why so?

I browsed through some of the earlier posts, and they happen to say
that the WIDTH attr for a <TD> is not supported.
The html is generated/rendered through an external app; hence nesting
of tables is out of the question....
This is basically for our intranet, and all systems use IE 5.5+

Anyone out there with an answer?? I hope someone will oblige.

Regards,
Rithish.

解决方案

ri*****@dacafe.com (Rithish) wrote:

Hi folks.

A premature and redundant question maybe... But I have a TABLE
problem.

This is almost something like what I want to acheive.

-----------------------------------------
| | | | |
| Col1 | Col2 | Col3 | Col4 |
| | | | |
-----------------------------------------
| | |
| | Colspan=3 |
| | |
-----------------------------------------

And this is what I have been trying...

<HTML>
<HEAD></HEAD>
<BODY>
<TABLE BORDER=1 ALIGN="CENTER" CELLSPACING="0" WIDTH="744px" STYLE="">
[first row:]<TR>
<TD WIDTH="372px" ALIGN=CENTER VALIGN=MIDDLE STYLE=""> Description of
Goods</TD> ....

[second row:]<TR>
<TD HEIGHT="200px" COLSPAN=1 ALIGN=LEFT VALIGN=TOP
STYLE="word-wrap:normal;"> This is an html test to see why the widths
of the columns go haywire when large text is input... </TD>


....

First: If in the first row you tell the browser that the table''s first
column is 372 pixels wide, and then in the second row you tell it that
the first column is 200 pixels wide, what do you *expect* the poor
browser to do?

Second: The HTML "width" attribute is valid in HTML 4.01 transitional
but not in strict. As with all layout characteristics, recommended
practice is to use CSS rather than HTML attributes. The same goes for
alignment, borders, and cell spacing.

Third: The HTML "width" attribute is treated as a minimum width, not a
maximum. If the content is too large for the stated width, the actual
width will be larger than the stated width.

--
Harlan Messinger
Remove the first dot from my e-mail address.
Veuillez ?ter le premier point de mon adresse de courriel.


Harlan Messinger wrote:

ri*****@dacafe.com (Rithish) wrote:

Hi folks.

A premature and redundant question maybe... But I have a TABLE
problem.

This is almost something like what I want to acheive.

-----------------------------------------
| | | | |
| Col1 | Col2 | Col3 | Col4 |
| | | | |
-----------------------------------------
| | |
| | Colspan=3 |
| | |
-----------------------------------------

And this is what I have been trying...

<HTML>
<HEAD></HEAD>
<BODY>
<TABLE BORDER=1 ALIGN="CENTER" CELLSPACING="0" WIDTH="744px" STYLE="">


[first row:]

<TR>
<TD WIDTH="372px" ALIGN=CENTER VALIGN=MIDDLE STYLE=""> Description of
Goods</TD>



...

[second row:]

<TR>
<TD HEIGHT="200px" COLSPAN=1 ALIGN=LEFT VALIGN=TOP
STYLE="word-wrap:normal;"> This is an html test to see why the widths
of the columns go haywire when large text is input... </TD>



...

First: If in the first row you tell the browser that the table''s first
column is 372 pixels wide, and then in the second row you tell it that
the first column is 200 pixels wide, what do you *expect* the poor
browser to do?



It''s the height that is 200px, not the width, but your point is still
valid. Given a fixed rectangular size and an arbitrary amount of text,
what can the browser do?

--
Mark.



"Mark Tranchant" <ma**@tranchant.plus.com> wrote in message
news:_S*****************@stones.force9.net...

Harlan Messinger wrote:

ri*****@dacafe.com (Rithish) wrote:

Hi folks.

A premature and redundant question maybe... But I have a TABLE
problem.

This is almost something like what I want to acheive.

-----------------------------------------
| | | | |
| Col1 | Col2 | Col3 | Col4 |
| | | | |
-----------------------------------------
| | |
| | Colspan=3 |
| | |
-----------------------------------------

And this is what I have been trying...

<HTML>
<HEAD></HEAD>
<BODY>
<TABLE BORDER=1 ALIGN="CENTER" CELLSPACING="0" WIDTH="744px" STYLE="">
[first row:]

<TR>
<TD WIDTH="372px" ALIGN=CENTER VALIGN=MIDDLE STYLE=""> Description of
Goods</TD>



...

[second row:]

<TR>
<TD HEIGHT="200px" COLSPAN=1 ALIGN=LEFT VALIGN=TOP
STYLE="word-wrap:normal;"> This is an html test to see why the widths
of the columns go haywire when large text is input... </TD>



...

First: If in the first row you tell the browser that the table''s first
column is 372 pixels wide, and then in the second row you tell it that
the first column is 200 pixels wide, what do you *expect* the poor
browser to do?



It''s the height that is 200px, not the width,



Oops. What''s the emoticon for "embarrassed"?
but your point is still
valid. Given a fixed rectangular size and an arbitrary amount of text,
what can the browser do?




这篇关于TD:插入冗长数据时col的宽度变得混乱。为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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