Help in fixing the width of a table

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
coder500
Forum Newbie
Posts: 20
Joined: Fri Jul 25, 2008 10:24 am
Location: Singapore

Help in fixing the width of a table

Post by coder500 »

How can I fix the width of a table?
I am using style sheet. Its content is as follows.

Code: Select all

 
#leftBorder { 
height: 100%; 
width: 125px; 
left: 0px; 
top: 0px; 
padding: 0px; 
 
background-position: top; 
background-image: url(images/slicepx6_02.gif); 
background-repeat: repeat-y; 
} 
#rightBorder { 
height: 100%; 
width: 111px; 
left: 0px; 
top: 0px; 
padding: 0px; 
 
background-image: url(images/slicepx6_04.gif); 
background-repeat: repeat-y; 
} 
 
#maintable { 
height: 100%; 
width: 800px; 
left: 0px; 
top: 0px; 
padding: 0px; 
}
 
#contenttable { 
height: 100%; 
width: 564px; 
left: 0px; 
top: 0px; 
padding: 0px; 
}
 
But when I add more content to the column with the id "contenttable" it expands. Is there any way to fix it, so that when I add spaces and content the width remains same and the text goes to the next line automatically.
Any help please...
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: Help in fixing the width of a table

Post by pickle »

Tables should respect the static width you set, if they can. When they grow beyond the width you've set, it's because the contents of the table cannot fit within what you've set. You could set the overflow property of the table to "hidden" or "scroll". You could do that for the individual table cells as well.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Post Reply