Вопрос

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