HighDots Forums  

css wrap v attribute wrap

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss css wrap v attribute wrap in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
foldface@yahoo.co.uk
 
Posts: n/a

Default css wrap v attribute wrap - 09-09-2004 , 03:31 AM






(reposting due to unrelated noise in original post)

Hi
In the example below on a normal size screen everything looks the
way you would think it would (on IE6). My problem is what happens when I
add more entries into the table (equivilent here to making the IE window
smaller)

- If you make the window smaller then the first column text starts to
wrap, which I don't want
- If you remove the width part, which gets ignored anyway, then the
text
no longer wraps and a scrollbar appears, which is what I want.
- just adding the attribute nwrap doe what I want, but I would rather have
a css solution

The problem is that I do want to set the width of the first column,
but
I want the rest of the table to be as small and fitted as possible

Any ideas?

Ta
F

<style>
..Bob
{
white-space: nowrap;
width: 500px;
}
..Sue
{
white-space: nowrap;
}
</style>
<table>
<tr>
<td class=Bob>Some random text </td>
<td class=Sue>Some random text </td>
<td class=Sue>Some random text </td>
</tr>
</table>
<hr>
<table>
<tr>
<td class=Bob nowrap>Some random text </td>
<td class=Sue>Some random text </td>
<td class=Sue>Some random text </td>
</tr>
</table>

Reply With Quote
  #2  
Old   
Jukka K. Korpela
 
Posts: n/a

Default Re: css wrap v attribute wrap - 09-09-2004 , 03:48 AM






foldface (AT) yahoo (DOT) co.uk wrote:

Quote:
(reposting due to unrelated noise in original post)
Hmmm.

Quote:
In the example below on a normal size screen everything looks the
way you would think it would (on IE6). My problem is what happens
when I add more entries into the table (equivilent here to making the
IE window smaller)
Why don't you post a URL or two so that we can look at the problem as you
see it, instead of gazillions of people doing the same thing, namely
trying to reconstruct your problem and misunderstanding what you really
mean?

And why do you set width in pixels? How does that work for, say, a font
size of 42px?

My guess is that your problem relates to the feature that widths for
table columns are determined in a fairly complex manner, potentially
overriding the widths you set, at least when you don't set
table-layout: fixed, which is an interesting way of opening
several cans of worms at the same time.

--
Yucca, http://www.cs.tut.fi/~jkorpela/


Reply With Quote
  #3  
Old   
Alexander Clauss
 
Posts: n/a

Default Re: css wrap v attribute wrap - 09-09-2004 , 06:56 AM



Jukka K. Korpela <jkorpela (AT) cs (DOT) tut.fi> wrote:

Quote:
My guess is that your problem relates to the feature that widths for
table columns are determined in a fairly complex manner, potentially
overriding the widths you set, at least when you don't set
Unfortunately almost all "big" browsers are just doing the wrong thing
when you use "nowrap" in table cells, also they are doing often the
wrong thing with the width of table cells.

Most browsers will ignore the "nowrap" attribute if a width is specified
for the cell as well. This is wrong, because the specified width must be
treated as minimum width (see the section about table formatting in the
CSS specification). So it is OK if the the final width of a cell is
larger then the specified one. So it can make sense to use "nowrap" and
"width" at the same time.

Also browsers are reducing the specified width (which is the minimum
width) of a cell if the specified width of the table itself is "too
small". But this is also wrong, because the resulting width of the table
itself must be the maximum of the specified width of the table and the
sum of the cell widths.

Maybe the browser developers try to mimic the behavior of the old
browser releases to avoid conflicts with web sites. But in my opinion
this would be only OK for the "Quirks" mode, but they're doing this also
in "standards compliant" mode, which is a very bad idea IMHO.


--
Alexander


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.