HighDots Forums  

ellipses in a div / table that cut off too long text (and resize with changing widths)

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


Discuss ellipses in a div / table that cut off too long text (and resize with changing widths) in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
jawolter@gmail.com
 
Posts: n/a

Default ellipses in a div / table that cut off too long text (and resize with changing widths) - 12-23-2005 , 03:14 AM






I have a div that uses the
overflow:hidden;text-overflow:eillipsis;white-space:nowrap css tags.
This holds a very long line of text which fills any percentage of the
screen's width. If I make the screen more narrow--less of the line of
text shows, and dot dot dot shows at the end to indicate more text is
in the line.

</div>
<div STYLE="clear:none;width:45%;white-space:nowrap;border:thin solid
black;overflow:hidden;text-overflow:ellipsis;margin:2px;"> As you can
see, this would work very well in the interface, and as more browsers
support it, could easily become the preferred presentation style for
users. </div>
</div>

Due to previous (poor) design decisions, these lines of text must be in
a table cell. My idea was if the table cell was 35% of the page and I
could put a div inside it and fiddle with the div's width and
everything would work. However it does not work.Can anyone help?

I've tried the following:


<table border="1" cellspacing="0" cellpadding="0">
<tr>
<td width="20%">dsdsjdkfjasldfjlas</td>
<td width="80%"><div
STYLE="white-space:nowrap;overflow:hidden;text-overflow:ellipsis"> As
you can see, this would work very well in the interface, and as more
browsers support it, could easily become the preferred presentation
style for users. </div></td>
</tr>
</table>


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

Default Re: ellipses in a div / table that cut off too long text (and resize with changing widths) - 12-23-2005 , 06:23 AM






jawolter (AT) gmail (DOT) com wrote:

Quote:
I have a div that uses the
overflow:hidden;text-overflow:eillipsis;white-space:nowrap css tags.
I'm not surely whether this is a good idea even in a situation where the
nonstandard text-overflow property is supported by a browser. It is not
crystal clear to users what's going on.

Quote:
Due to previous (poor) design decisions, these lines of text must be in
a table cell. My idea was if the table cell was 35% of the page and I
could put a div inside it and fiddle with the div's width and
everything would work.
When using the technique inside a cell, you need
table-layout: fixed
for the table, in addition to setting widths for cells. (Without it, the
width settings are just suggested minimum widths.)

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


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 - 2009, Jelsoft Enterprises Ltd.