controlling table length

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
pleigh
Forum Contributor
Posts: 445
Joined: Wed Jan 19, 2005 4:26 am

controlling table length

Post by pleigh »

if i have a table with a length of

Code: Select all

------------
|          |
------------
and i have a word, a very long word, or let's say an email address like

thisisalongemailaddress@someemailaddress.com

the tendency of the table is to adjust the length to accomodate the characters of the word or email address, looking like

--------------------------------------------
thisisalongemailaddress@someemailaddress.com|
--------------------------------------------

now, my question, is there a way i can control this?i mean, if the first table is the length of my table, iserted a long word, the length of the table will not adjust and the remaining letters will automatically goes to the next line...is it possible??if yes, how??

thanks in advance
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

It's not possible to split up a word like that with just HTML. A string like that is treated as 1 word, so HTML won't split it. You could use the PHP function wordwrap() to break it up, or use Javascript to insert a <br /> after a certain number of characters, after parsing through it.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

You could use overflow:auto but I believe it would just scroll it, instead of wrapping it to the next line.
Post Reply