I’d like to find out the width of a TD which has defined style='width: 200px;, but the text makes it longer (no break). I want to find out the effective width and, as long it is bigger than 200px, shrink the text size in it for about 2px each time.
Is this possible at all?
This can be done in javascript but it’s a little complex.
Here’s the complete working example : http://jsfiddle.net/dystroy/kdrrA/
The HTML :
The CSS :
The javascript :
Note that I had to add a span in the cell because TD width computation by jquery doesn’t work very well.