Wrapping Text


Is there any way to force text to wrap within a cell, or even outside of a cell?

Who is Participating?
COBOLdinosaurConnect With a Mentor Commented:
unless, of course it does not have spaces in it, in which case it will not wrap.  

Then it will expand the cell to be the necessary size.

If that is the problem then it needs to have spaces inserted.  If the page is dynamically generated, it will need to have scripting to do that either on the server or with JavaScript on the page.

For IE and Netscrap 6 you can also manupulate it with the style attribute overflow which allows to truncate of use a scrolling div in the cell.

specify a width in the cell:

<TD width='200'>
This text will wrap! This text will wrap! This text will wrap!

or, just use good ole <BR>  :)

This text will most certainly wrap!<BR>
This text will most certainly wrap!<BR>
This text will most certainly wrap!<BR>
Define 'wrap'

If you want text to run AROUND a cell, or a table -- you can for a table but not for a cell.

If you want text within a cell to word wrap -- break to the next line automatically -- then what's been given will do it.
ftbadolatoAuthor Commented:
The problem was I had no spaces. I was using &nbsp;.  I took those out and just inserted spacebar spaces and it worked!

Yes a bit tricky, nbsp means non-breaking space.  The look the same as a space, but the browser treats the like a visible character.

Glad we could help.  Thanks for the A. :^)

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.