Question

I would like to set the max-width of my table td.

<td class="showwindow description">
    <div style="width:275px; white-space:nowrap; word-wrap:break-word; font-size:11px;">3 DRESS COVER AY (AGAVE PINK) 3 DRESS COVER AY (AGAVE PINK) 3 DRESS COVER AY (AGAVE PINK)</div>
</td>

But the text can't back to the line :

enter image description here

Was it helpful?

Solution

Just remove "white-space:nowrap" property from the div and set max-width.

OTHER TIPS

Just use this CSS code:

max-width:100px;

http://www.w3schools.com/cssref/pr_dim_max-width.asp

you might have given width, but you have to give height to both td and div so that if text exceeds , it should fallback to next line, just giving only width wont do much

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top