aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes How to lock the width of a TD indipendently from text? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "How to lock the width of a TD indipendently from text?" Watch "How to lock the width of a TD indipendently from text?" New topic
Author

How to lock the width of a TD indipendently from text?

Giulietta Blumarine
Ranch Hand

Joined: Dec 03, 2004
Posts: 59
Hi!
I have a table with width="200".
In this table I have a td in which I show a text.
If this text is too long and all attached(for example: GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG), this text goes beyond table width and exceeds 200.
How to force and lock the width=200, sending the text down to head?
Thanks!!!

Giu
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60055
    
  65

I do not believe that you can do anything like that in the browsers using the td element.

You might try embedding a <div> in the td and using the width, overflow and/or clip CSS rules to obtain the behavior that you want.
[ August 03, 2006: Message edited by: Bear Bibeault ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Giulietta Blumarine
Ranch Hand

Joined: Dec 03, 2004
Posts: 59
Hi!
I have tried div style="width:100px;" inside the TD but nothing....
There is some other CSS rule?

Thanks
GIU
Arulanand Dayalan
Ranch Hand

Joined: Aug 10, 2005
Posts: 124
Try this
style='width:400;text-wrap;word-wrap: break-word;'
Liu Zhixiang
Ranch Hand

Joined: Aug 12, 2006
Posts: 32
table { table-layout:fixed;}
td { text-overflow:ellipsis;overflow:hidden;white-space: nowrap;padding; }

add in your stylesheet.

ou ,ye
you can control the td's width. ((IE ONLY))





text-overflow:ellipsis|clip; ellipsis:“…” clip:there is no "…"

[ August 14, 2006: Message edited by: snowwolf ]

[ August 14, 2006: Message edited by: snowwolf ]
[ August 14, 2006: Message edited by: Liu Zhixiang ]

I Think Therefore I Am
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to lock the width of a TD indipendently from text?
 
Similar Threads
how to get utf-8 data from query string in JSP
Is there a plugin available (e.g. jquery etc) to achieve this functionality?
From Velmurugan's Notes
when will a thread stop
Display values form database