aspose file tools
The moose likes HTML, CSS and JavaScript and the fly likes Wrapping body text in HTML Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Practical Unit Testing with TestNG and Mockito this week in the Testing forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "Wrapping body text in HTML" Watch "Wrapping body text in HTML" New topic
Author

Wrapping body text in HTML

Arvind Prabhu
Greenhorn

Joined: Aug 09, 2001
Posts: 18
How can I limit the width of a table column to be smaller than it's contents? For example, I have a table column with the following value:

wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww

(Notice there are no spaces in the string above) But I want it's width to be just 20 pixels, and when displayed, I'd like the string above to be chopped off and maybe displayed as such:

wwwwwwwwwwww...

I know that getting the "..." might mean custom code; however, is there a standard HTML way of limiting width to be smaller than the actual contents?

Along the same lines, if I have the same text in the body of page and I make the window narrow, is there any way to make the text auto wrap such that the horizontal scroll bar does not appear in the window?

Thanks,
-Arvind
Arvind Prabhu
Greenhorn

Joined: Aug 09, 2001
Posts: 18
Following up on the above, see what happens to this window if I include a string like the one below:

wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww

This is precisely what I'm trying to avoid.
Thanks,
-Arvind

[edit, I want to read the post, not scroll! Eric]
[ May 25, 2004: Message edited by: Eric Pascarello ]
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15003
read: http://www.experts-exchange.com/Web/Web_Languages/HTML/Q_20936377.html

Eric
 
 
subject: Wrapping body text in HTML
 
Threads others viewed
Combining css margin and table width in percentages
Positioning the column in the table
how to center table heading
How to determine size of TableColumn text?
JTable width and height
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com