문제

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

도움이 되었습니까?

해결책

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

다른 팁

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top