Topic: alternative to white-space:nowrap (IE bug?) (Page 1 of 1) Pages that link to <a href="http://ozoneasylum.com/backlink?for=27539" title="Pages that link to Topic: alternative to white-space:nowrap   (IE bug?) (Page 1 of 1)" rel="nofollow" >Topic: alternative to white-space:nowrap   (IE bug?) <span class="small">(Page 1 of 1)</span>\

 
GRUMBLE
Paranoid (IV) Mad Scientist

From: Omicron Persei 8
Insane since: Oct 2000

IP logged posted posted 02-20-2006 18:44 Edit Quote

hello
i have a long table and in the first row (the rows-description) i want no line break to occur, so i write this.

code:
<tr style="white-space:nowrap;">
<td>...</td><td......



unfortunately this doesnt seem to work in IE, there are still line breaks, while FF and OP work as expected. does anyone know an easy work around for this?

poi
Paranoid (IV) Inmate

From: Norway
Insane since: Jun 2002

IP logged posted posted 02-20-2006 19:09 Edit Quote

why not simply using TH tags and doing:

code:
th
{
    white-space:nowrap;
}

'cause I guess IE can't apply the white-space property to a TR but it can probably do to a TD or TH

DL-44
Lunatic (VI) Inmate

From: under the bed
Insane since: Feb 2000

IP logged posted posted 02-20-2006 20:27 Edit Quote

^ that should do it.

The <tr> shouldn't really have styles applied to it - very often they won't be interpreted the way you want them to.

Also, if your making a header.....code it as a header (<th>)!



(Edited by DL-44 on 02-20-2006 20:28)

GRUMBLE
Paranoid (IV) Mad Scientist

From: Omicron Persei 8
Insane since: Oct 2000

IP logged posted posted 02-20-2006 22:27 Edit Quote

ok, it works with <th> or <td>. thank you!

i just thought i could save some code by applying a style to the mother element, which should be inherited to its children.

DL-44
Lunatic (VI) Inmate

From: under the bed
Insane since: Feb 2000

IP logged posted posted 02-20-2006 22:44 Edit Quote
quote:

GRUMBLE said:

i just thought i could save some code by applying a style to the mother element, which should be inherited to its children.



Would save more code and time by

1) using the proper mark-up (ie <th> )

2) either applying the style to all <th> (as poi demonstrated) or by applying a class to the table, and specifying it accordingly in the CSS -

table.class th {
...
}
Keep the 'style' attribute out of your markup, and don't bother putting a class in each <th>.


You have to remember that each element has default settings, which vary by user agent. Style attributes are not automatically inherited by child elements of a different type.



(Edited by DL-44 on 02-20-2006 22:45)

GRUMBLE
Paranoid (IV) Mad Scientist

From: Omicron Persei 8
Insane since: Oct 2000

IP logged posted posted 02-20-2006 23:48 Edit Quote

thanks, DL! i will do the "table.class th" thing.

quote:
Style attributes are not automatically inherited by child elements of a different type



oh, now that explains a couple of things...

Skaarjj
Maniac (V) Mad Scientist

From: :morF
Insane since: May 2000

IP logged posted posted 03-06-2006 03:57 Edit Quote

Hence hwy every property that is inheritable has the absolute definition setting of "inherit"


Justice 4 Pat Richard



Post Reply
 
Your User Name:
Your Password:
Login Options: Remember Me On This Computer
 
Your Text:
Loading...
Options: Show Signature
Enable Slimies
Enable Linkwords

« BackwardsOnwards »

Show Forum Drop Down Menu