Welcome to WebmasterWorld Guest from 54.196.144.242

Forum Moderators: mack

Message Too Old, No Replies

Table width Problems

I'm probably just being dumb but.....

     
12:34 pm on Dec 21, 2005 (gmt 0)

Junior Member

10+ Year Member

joined:Mar 15, 2004
posts:192
votes: 0


Hi,

Ok, I have my table that I want set at 150px. The contents within the table could be anything, in this case a 50 character string:

12345678901234567890123456789012345678901234567890

Due to the string's length (and it having no spaces) is pushing my table width out.

<table width="150">
<tr><td>
12345678901234567890123456789012345678901234567890
</td></tr>
</table>

I've had this problem a few times now and I know that its probably simple html but I must have been off school that day ;) How do I force a carriage return when it reaches the 150 width limit?

1:44 pm on Dec 21, 2005 (gmt 0)

Preferred Member from ES 

10+ Year Member

joined:Nov 13, 2005
posts:646
votes: 0


You can't (at least in plain HTML).
Do it manually.
2:33 pm on Dec 21, 2005 (gmt 0)

Junior Member

10+ Year Member

joined:Mar 15, 2004
posts:192
votes: 0


What do you mean by 'do it manually'? Any code I can look at?
2:54 pm on Dec 21, 2005 (gmt 0)

Junior Member

10+ Year Member

joined:Apr 25, 2004
posts:150
votes: 0


He means do it manually. You need to put a space or break in the string of characters somewhere. A single string will not "break itself" to wrap within a table width.

3:02 pm on Dec 21, 2005 (gmt 0)

Moderator This Forum from GB 

WebmasterWorld Administrator mack is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:June 15, 2001
posts:7583
votes: 11


Perhaps it doesnt have to be done manualy. If you use some form of server side scripting to extract the data you could take care of the arangement of the letters at the same time.

What server side scripting language (perl, php asp etc) do you use.

Mack.

4:42 pm on Dec 21, 2005 (gmt 0)

Junior Member

10+ Year Member

joined:Mar 15, 2004
posts:192
votes: 0


Hi Mack,

I use PHP but in a way my question has been answered...you can't do it. I knew I could do this with php, but for some reason, I thought you could do this in html.

Thanks all :)