<td width=...> in IE

J

jodleren

Hi!

I have problems with the following code in IE, but it works well in
Firefix.

<table border=1>
<tr>
<td>a b</td>
<td width=25>c</td>
</tr>
<tr>
<td colspan=2>The red fox jumped over the lazy dog</td>
</tr>
</table>

Idea: the top row, cell 1 - as wide as possible, cell 2, specified
width - (or as short as possbile if that can help. Setting cell one
just to take up all remaining space is ok too)
IE cannot handle this. Any suggestions?

WBR
Sonnich
 
J

Jukka K. Korpela

Scripsit jodleren:
I have problems with the following code in IE, but it works well in
Firefix.

<table border=1>
<tr>
<td>a b</td>
<td width=25>c</td>
</tr>
<tr>
<td colspan=2>The red fox jumped over the lazy dog</td>
</tr>
</table>

In a <td> element, the width attribute specifies (by HTML specs) the
suggested minimum width, so both IE and Firefox behave by the specs, just
differentöy.
Idea: the top row, cell 1 - as wide as possible, cell 2, specified
width - (or as short as possbile if that can help. Setting cell one
just to take up all remaining space is ok too)
IE cannot handle this. Any suggestions?

Use <table style="table-layout: fixed">. This effectively sets, as a side
effect, the total width of the table to 100%, but this seems to be what you
want.
 
S

Sonnich Jensen

Scripsit jodleren:



In a <td> element, the width attribute specifies (by HTML specs) the
suggested minimum width, so both IE and Firefox behave by the specs, just
differentöy.


Use <table style="table-layout: fixed">. This effectively sets, as a side
effect, the total width of the table to 100%, but this seems to be what you
want.

Thank you that explains it. The solution is is ok, but requieres
nested tables to have the same. I'll play around with it to see what
is possbile here.
Other ideas still welcome.

Thanks
Sonnich
 
J

Jukka K. Korpela

Scripsit Sonnich Jensen:

[a fullquote, the usual way of indicating lack of comprehensive readins ]
Thank you that explains it.

Which "that" explains "it"? (Please don't answer. This was a rhetoric
question.)
The solution is is ok,

It depends on what the problem really is. It wasn't explained, so I decided
to answer just the question that was asked.
but requieres nested tables to have the same.

Same what? What should have the same what and why? And why would you need
nested tables? Any "solution" that requires nested tables is a non-solution,
often to a non-problem.
Other ideas still welcome.

How about telling the real problem, demonstrating it with a URL, and using
consistently your real name, if you were the original poster?
 
R

richard

Hi!

I have problems with the following code in IE, but it works well in
Firefix.

<table border=1>
<tr>
<td>a b</td>
<td width=25>c</td>
</tr>
<tr>
<td colspan=2>The red fox jumped over the lazy dog</td>
</tr>
</table>

Idea: the top row, cell 1 - as wide as possible, cell 2, specified
width - (or as short as possbile if that can help. Setting cell one
just to take up all remaining space is ok too)
IE cannot handle this. Any suggestions?

WBR
Sonnich


width=25? 25 what? Pixels or percent?
width="25" equals pixels where as "25%" defines percent.

First, you would need to define width in the table tag.
<table width="100">
Otherwise it assumes 100%.
Defining the width of only one cell would play havoc on the others as
data changes within them.
Define the first as say "50" then the second as "25", leaving the 3rd
to use what ever is left.
At least this way the cells would keep some sort of order in them.
 
J

Jonathan N. Little

width=25? 25 what? Pixels or percent?
width="25" equals pixels where as "25%" defines percent.

It would be pixels. The HTML attribute is in pixels unless you
explicitly use the "%" unit identifier width="25%" T think you are
confusing it with CSS properties where unit identifiers are required[1]
for length values, width: 25px;

[1]optional for "0" values and with line-height property.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top