Adjust fontsize in fixed-height/width table cells in javascript/jquery?

Try wrapping the contents of each cell with another element (table cells don't support overflow :hidden ) with white-space: nowrap and overflow: hidden and reducing the font-size of that element until it's contents fit into it.

Try wrapping the contents of each cell with another element (table cells don't support overflow :hidden) with white-space: nowrap and overflow: hidden and reducing the font-size of that element until it's contents fit into it. Example code: HTML: cell another cell yet another cell CSS: td span { display: block; white-space: nowrap; width: 100px; overflow: hidden; font-size: 100%; } JS: $(function() { $('td span'). Each(function() { var fontSize = 100; while (this.

ScrollWidth > $(this).width() && fontSize > 0) { // adjust the font-size 5% at a time fontSize -= 5; $(this). Css('font-size', fontSize + '%'); } }); }); Working version of the example (JSBin).

Thanks, this worked for me! – Poru Jul 21 '11 at 17:16.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions