Continuous string not wrapped in td

When I put a long continuous string in my fixed width td, it does not wrap. The row increases the width of the table. Can someone please help me with this.

For instance:

this is my text --- it works fine, since in td the width is fixed only to increase the height but if I insert thisismytext --- then it increases the width of the table.

+4
source share
5 answers

you should use

word-break: break-all 

for td

 <style> .BreakWord { word-break: break-all; } </style> <td class="BreakWord">longtextwithoutspace</td> 
+14
source

and for this to work in firefox

word-wrap:break-word;

+1
source

In other words, give the browser a reason to break the line (by including spaces in the content) and this will happen. Make it use one line (omitting spaces) and increasing the width of the table.

In the absence of any additional layout rules, what else could he do?

Edit: there might be cross-browser issues with word-break / wbr (now it's CSS3, but was previously an invention of IE)

0
source

If your text and cell width are corrected, you can add

 <td>My text<br />on a different line</td> 

Sometimes I find that the text wraps, only the height td hides it

0
source

Use the <wbr> in your text every few characters (20? 30? Do you need to experiment). This will allow breaks in the text without spaces. Like this:

 <td>LongLongLong<wbr>TextTextText</td> 

It will be all tense if you do not need a break.

0
source

All Articles