Forum Moderators: open

Message Too Old, No Replies

How to prevent a table from widening

How to prevent a table from widening

         

spremji

12:48 am on May 31, 2002 (gmt 0)



Hi,

This is a really simple problem but I'm going wacko over this.

I created a simple table of say 500 pixels wide and inside, I created a cell (tr & td) of the same width as the table.

When I type some content inside the cell (which is inside the table), when it reaches the end of the table wall, instead of cutting off and continue on the next line, it just keeps on expaning the cell and the table as long as the content is entered.

How do I make the content wrap up to the next line ? An example code would help too :)

Thanks a lot.

DrDoc

1:39 am on May 31, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Did you set the TD width to 500?

Also, you can always use CSS to specify the width ..

spremji

1:45 am on May 31, 2002 (gmt 0)



Yes I did, but still it doesn't work. Here's my simple code:

<html>
<head>
<title>Test</title>
</head>

<body bgcolor="#FFFFFF" text="#000000">
<table width="200" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="200" height="200" valign="top">type here till u hit the wall</td>
</tr>
</table>
</body>
</html>

Purple Martin

1:51 am on May 31, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I just pasted that sample code, bunged in a whole heap more text, looked at it in IE5.5 and it wrapped in the cell just as it should :S

Is it happening in an editor, or in a browser?

spremji

1:58 am on May 31, 2002 (gmt 0)



Very good point !

It is happening in the editor. I checked in the browser and it only works so long as a given word has a space but if you type like aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa continuously, even the in the browser, the table still expands.

papabaer

2:11 am on May 31, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi spremji,

Since the issue is occuring in your editor, and not in the actual browser rendering, you may want to visit our new WYSIWYG and Text Code Editors forum. There are already some great threads going. Check it out: [webmasterworld.com...]

All the best!
papabaer

spremji

2:22 am on May 31, 2002 (gmt 0)



The problem is in the browser rendering.

I know so many WYSIWYG tools, however, this is actually for designing a common template skeleton for my entire site.

I have a background image that indicates the end of wall to make it user-friendly. Now, inside this table, I am afraid that if the text doesn't get wrapped, then the content will expand the table, thus overstepping the boundary line image (background image).

I am not a designer but a developer and just need some basic tips so that I can get into bigger things.

lorax

2:36 am on May 31, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



spremji

but if you type like aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa continuously

Your test isn't a fair one.

As far as the editor and the browser are concerned that's one looooonnnnggggg word. In a normal sentence you'll have words that average 6-12 characters each with spaces in between. Use a real sentence and see if it wraps. My bet is it will.

spremji

2:53 am on May 31, 2002 (gmt 0)



I respect that argument and I did realize about my unfair test.

Thanks for the input guys and I'll keep you all posted in case it doesn't workout.