473,503 Members | 1,700 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

css wrap v attribute wrap

(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>
Jul 20 '05 #1
2 15509
fo******@yahoo.co.uk wrote:
(reposting due to unrelated noise in original post)
Hmmm.
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/
Jul 20 '05 #2
Jukka K. Korpela <jk******@cs.tut.fi> wrote:
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
Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
21091
by: Toronto Web Designer | last post by:
<textarea name="application" cols="50" rows="12" wrap="virtual" class="textarea"></textarea> Apparently "wrap" is deprecated or not allowed for html 4.01, any suggestions on what I should use...
5
28066
by: Toronto Web Designer | last post by:
<textarea name="application" cols="50" rows="12" wrap="virtual" class="textarea"></textarea> Is there a way to include the wrap in CSS or is that a structure thing?
8
52981
by: Mark D. Smith | last post by:
Hi I have googled but not found a solution to wordwrap in a textarea using firefox/netscape. is there a style sheet solution or am i stuck with not being able to force wrapping in a textarea...
4
8491
by: Gérard Talbot | last post by:
Hello fellow stylers, What would be the best CSS equivalent of MSIE's wrap="off" and wrap="hard"? hard Text is displayed with wordwrapping and submitted with soft returns and line feeds. ...
3
14561
by: Jason | last post by:
Anyone know how to make the text wrap in a text box of a DetailsView?
2
19254
by: mattrapoport | last post by:
Hello, I am have a div and inside of that div I have a textarea. There is nothing else in the div. The text in the textarea will come from a database so it needs to be able to wrap and grow as...
10
72647
by: Lorenzo Thurman | last post by:
I have a table cell that I want to wrap text inside of. I've tried both hard and soft wrap, but Firefox refuses to obey. IE 6&7 handle the wrap just fine. Does anyone know how I can fix this?
6
3731
by: Victor | last post by:
Hi all i have a css question about how to wrap a long text by using css. for example I have a very long text like "ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd" there...
1
2763
by: Deepupriya | last post by:
hi can anyone tell me how to use wrap attribute for a table data.. or can i use any style attribute to wrp the table date
0
7202
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
1
6991
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7458
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5578
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5013
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3154
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1512
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
380
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.