Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Sheriff
Posts: 67750
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Giulietta Blumarine
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!
I have tried div style="width:100px;" inside the TD but nothing....
There is some other CSS rule?

Thanks
GIU
 
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try this
style='width:400;text-wrap;word-wrap: break-word;'
 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Creativity is allowing yourself to make mistakes; art is knowing which ones to keep. Keep this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic