| View previous topic :: View next topic |
| Author |
Message |
jburns131
Joined: 18 Oct 2005 Posts: 5
|
Posted: Tue Oct 18, 2005 3:30 pm Displaying a fixed width in table, regardless of the content |
|
|
|
I am trying to make a basic webpage layout, a banner/logo on top that streches all the way across the top, under that I want to have 2 sides that are about 20% of the pages width on either side, and I want to have the middle section to have a width of 60%. I think that's a very basic setup, but if I use the following code, the middle and sides only display the width of the content that I place inside it.
| Code: |
<body>
<table class='logo'>
<tr>
<td>
</td>
</tr>
</table>
<br />
<table bgcolor='#F9F9F9'>
<tr>
<td width='20%'>
Left Side
</td>
<td width='60%'>
<table bgcolor='#E9E9E9'>
<tr>
<td>
This is the middle
</td>
</tr>
</table>
</td>
<td width='20%'>
Right Side
</td>
</tr>
</table>
</body>
|
I want the middle and sides to stay the same sizes (20%, 60%, 20%) regardless of the content. What am I doing wrong? |
|
Superpetauction

Joined: 07 Oct 2005 Posts: 47 Location: Logansport, Indiana
|
Posted: Tue Oct 18, 2005 4:11 pm Re.. |
|
|
|
is this what you are asking?
| Code: |
<table class='logo' width="100%">
<tr>
<td>
</td>
</tr>
</table>
<br />
<table bgcolor='#F9F9F9' width="100%">
<tr>
<td width='20%'>
Left Side
</td>
<td width='60%'>
<table bgcolor='#E9E9E9' width="100%">
<tr>
<td>
This is the middle
</td>
</tr>
</table>
</td>
<td width='20%' width="100%">
Right Side
</td>
</tr>
</table> |
|
|
Corey Bryant Site Admin

Joined: 15 May 2004 Posts: 8256 Location: Castle Rock CO USA
|
Posted: Tue Oct 18, 2005 4:28 pm |
|
|
|
It seems you are using XHTML? bgcolor is not supported by XHTML. For proper coding - we would need to know what the properties you have applied to the logo table. |
|
jburns131
Joined: 18 Oct 2005 Posts: 5
|
Posted: Wed Oct 19, 2005 8:01 am |
|
|
|
Thanks Superpetauction, that's exactly what I was looking for.
And Corey, I'm still learning the differences between html and xhtml, but I don't think the class 'logo' and bgcolor have anything to do with the width of columns (I know, unless I'm using attributes that effect the layout), but I could be wrong. Let me know. And anyways, I want the width to be constant regardless of any attributes/styles I implement (other than layout styles).
And I admit, I have been shying away from css untill I have a better grasp on just basic html/xhtml, is this not a good idea?
Thank you both for the responses, I was racking my brain for hours yesterday trying to get this right. |
|
Corey Bryant Site Admin

Joined: 15 May 2004 Posts: 8256 Location: Castle Rock CO USA
|
Posted: Wed Oct 19, 2005 8:29 am |
|
|
|
| The reason I as asking - I did not know if you had a width / height in the logo class |
|
jburns131
Joined: 18 Oct 2005 Posts: 5
|
Posted: Wed Oct 19, 2005 9:01 am |
|
|
|
| Cool, that's what I thought. I am using an existing css, but it just defines colors and images, not width / hight. But I will look for those kind of things if using an existing css. |
|
jburns131
Joined: 18 Oct 2005 Posts: 5
|
Posted: Wed Oct 19, 2005 9:08 am |
|
|
|
| After looking at that code from Superpetauction alittle closer, I'm alittle confused about the last <td>, it has 2 width attributes. Does one override the other? Not sure of the logic that is happening there. Could anyone elaborate? Thanks. |
|
jburns131
Joined: 18 Oct 2005 Posts: 5
|
Posted: Wed Oct 19, 2005 9:24 am |
|
|
|
| I think I figured it out. I probably need to add another table in the <td> with a width of '100%', and get rid of the width='100%' in the <td> itself. Let me know if I'm right. |
|
|