Wrap text in <td> tag

sagar picture sagar · Jun 29, 2009 · Viewed 409.8k times · Source

I want to wrap some text that is added to a <td> element. I have tried with style="word-wrap: break-word;" width="15%". But it is not wrapping the text. Is it mandatory to give it 100% width? I have other controls to display so only 15% width is available.

Answer

Jitender Mahlawat picture Jitender Mahlawat · May 29, 2012

To Wrap TD text

First set table style

table{
    table-layout: fixed;
}

then set TD Style

td{
    word-wrap:break-word
}