burebistaruler burebistaruler - 13 days ago 6
HTML Question

Table th height not working

I have this problem with tables from my app.
When the description of a td from tr is very large this is pushing my th name on more lines. Is possible to set for tr th a height for example 10 px in order to not be modified on many lines when td description is very large?

Check my fiddle:
http://jsfiddle.net/ebG9N/40/


Answer

Yes, add the following bit of code to your CSS:

th { white-space:nowrap; }

Which is basically the equivalent of:

<span>Start&nbsp;date&nbsp;Column</span> <!-- &nbsp; = non-breaking space -->

Both methods ensure that the TH contents are not wrapped onto two lines.