Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Apr 26th, 2006, 12:08 AM   #1
Writlaus
Hobbyist Programmer
 
Writlaus's Avatar
 
Join Date: Nov 2005
Posts: 149
Rep Power: 3 Writlaus is on a distinguished road
advanced wordwrap?

If I have a table cell that has is only supposed to be (for example) 50% wide, but has the word WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW in it, is there a way I could have that cut off and begin on a new line after it gets past the 50% mark?
Writlaus is offline   Reply With Quote
Old Apr 26th, 2006, 12:19 AM   #2
Writlaus
Hobbyist Programmer
 
Writlaus's Avatar
 
Join Date: Nov 2005
Posts: 149
Rep Power: 3 Writlaus is on a distinguished road
I was just thinking, is there some special character that acts as a space but doesn't appear? I could scatter it in longer words so it splits it and makes a new line when it needs to.
Writlaus is offline   Reply With Quote
Old Apr 26th, 2006, 12:19 AM   #3
titaniumdecoy
Expert Programmer
 
titaniumdecoy's Avatar
 
Join Date: Nov 2005
Posts: 855
Rep Power: 3 titaniumdecoy is on a distinguished road
Send a message via AIM to titaniumdecoy
This will do the trick:
word-wrap: break-word;
(EDIT:) I did a little research, and I found the character ­. If you scatter it throughout a word, the word will break appropriately with a hyphen at the appropriate points. So, for example:

anti­dis­establish­ment­arian­ism
might become

antidisestablish-
mentarianism
If you don't want hyphens, apparently <wbr /> and & #8203; work as well.

Last edited by titaniumdecoy; Apr 26th, 2006 at 12:47 AM.
titaniumdecoy is offline   Reply With Quote
Old Apr 26th, 2006, 12:48 AM   #4
java_roshan
Professional Programmer
 
Join Date: Mar 2005
Location: Student of University of Mumbai, Maharashtra State, India
Posts: 344
Rep Power: 4 java_roshan is on a distinguished road
However, there's one problem with ­. Firefox, does not support it.

If you every tried this "Quick Reply" box, with a string having "NO SPACES" greater than 54 characters, there won't be a word wrap and the box would have a horizontal scroll bar!
__________________
Visit: http://www.somaiya.edu
java_roshan is offline   Reply With Quote
Old Apr 26th, 2006, 3:40 AM   #5
Writlaus
Hobbyist Programmer
 
Writlaus's Avatar
 
Join Date: Nov 2005
Posts: 149
Rep Power: 3 Writlaus is on a distinguished road
Where would I put that in the table tag? something like this?

<table style='word-wrap:break-word;'>

Because that's not working...
Writlaus is offline   Reply With Quote
Old Apr 26th, 2006, 4:01 AM   #6
mrynit
Hobbyist Programmer
 
mrynit's Avatar
 
Join Date: Mar 2006
Location: WA, USA
Posts: 332
Rep Power: 3 mrynit is on a distinguished road
Send a message via AIM to mrynit Send a message via MSN to mrynit Send a message via Yahoo to mrynit Send a message via Skype™ to mrynit
Quote:
Originally Posted by Writlaus
If I have a table cell that has is only supposed to be (for example) 50% wide, but has the word WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW in it, is there a way I could have that cut off and begin on a new line after it gets past the 50% mark?
post code.

what do you actualy put in the cell? are you sure this isnt an error. i think i have had this problem before. if the width is set auto word wrap should be implamented by the browser. that waht i think. i anit no HTML guru.
mrynit is offline   Reply With Quote
Old Apr 26th, 2006, 5:50 PM   #7
titaniumdecoy
Expert Programmer
 
titaniumdecoy's Avatar
 
Join Date: Nov 2005
Posts: 855
Rep Power: 3 titaniumdecoy is on a distinguished road
Send a message via AIM to titaniumdecoy
Writlaus, try using double quotes instead of single quotes.
titaniumdecoy is offline   Reply With Quote
Old Apr 26th, 2006, 6:58 PM   #8
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Quote:
try using double quotes instead of single quotes.
What is this, old Voodoo week?
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Apr 26th, 2006, 7:06 PM   #9
Dameon
Troll
 
Dameon's Avatar
 
Join Date: Apr 2005
Location: Texas
Posts: 732
Rep Power: 4 Dameon is on a distinguished road
Perhaps that style should be applied to <td>, the immediate parent of the text nodes in question? A quick way to affect them all would be through CSS.
__________________
MD5(sig) = bcef75433db02e9ad9bf81d6f7c5c270
Dameon is offline   Reply With Quote
Old Apr 27th, 2006, 2:12 AM   #10
Writlaus
Hobbyist Programmer
 
Writlaus's Avatar
 
Join Date: Nov 2005
Posts: 149
Rep Power: 3 Writlaus is on a distinguished road
I tried applying the style to <table>, <tr>, and <td>, all of which made no effect. And I tried the "voodoo" for kicks--that didn't work either, no big surprise.
Writlaus is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 10:27 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC