Skip to main content
GameDev.net gamedev.net
🔒 Locked

[web] wrapping text

Started by 3dmodelerguy Dec 19, 2005 at 6:43 AM 3 replies 750+ views
Original Post
3dmodelerguy
3dmodelerguy
Ok I am not sure if this is m,ysql/php/css issue. I have a working php script that reads in the 30 newest news items form mysql database and print them on on the websites along with css for formatting. What I started to notice after add php and mysql is that if I write none stop test no white line like: hasdofajshadbjckbnawergkasnbdrkahgsdknbfckashgfaksygdrkjbrsadkhsvjhzxnbfvawkjsrgaksjdbnfknasbfkjshgadfkbv That test goes over the potion of space it should, it is like the text will not "wrap" if there is no space. is there a way a wrapping text even if there is no space?
Illco
Illco
How about inserting a space? No, seriously.

Illco
kanzler
kanzler
You could use the proprietary IE word-wrap: break-word; style in your CSS but remember that this will make Santa cry.
Sander
Sander
You could break it up server-side. Take a look at PHP's wordwrap() function. Also look at the attached comments on that manual entry. It has several user-written wrapping functions you could use instead of wordwrap().
Pipo DeClown
Pipo DeClown
In PHP, I just wrote a simple (perhaps slow) word-wrapping function myself, where I can have my own max-chars-per-line and which characters it can break (so not only on spaces). I guess there still isn't an attribute that does this for you.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.