langel
langel

Reputation: 99

Why isn't my table 100% wide?

On a 100% wide page, I want a table that fills the whole screen. I'm having problems with the first table with image.

<table cellspacing="0" cellpadding="0" border="0" width="100%" align="center">
<tr>
<td bgcolor="$bordercolor">
<table border="0" cellspacing="100%" cellpadding="$tablespace" width="100%" >
<tr>
<td class="tablerow" bgcolor="$altbg2" background="images/idown/bga.png">
<table width="100%" border="0" cellspacing="0" cellpadding="0" >
<tr>
<td class="tablerow" align="left">$lang[loggedin] <a href=member.php?action=viewpro&amp;member=$xmbuser>$xmbuser</a> $loginout | $lastvisittext <br>$newu2umsg</td>
<td class="tablerow" align="right" >$searchlink $links $pluglink</td>
</tr>
</table>
</td>
</tr>
</tr>
</table>
</td>
</tr>
</table>

(Also http://ydown.totalh.com/forum/.)

Upvotes: 1

Views: 944

Answers (4)

user982473
user982473

Reputation: 11

The answer to this question probably has nothing to do with nested tables for most people. There is actually some border or margin present in the body element containing the table. You should add some style attributes like margin:0px;border:0px to the BODY element to eliminate it.

Upvotes: 1

Gordon Tucker
Gordon Tucker

Reputation: 6773

You have nested tables. If you really want to have 100% on that table, you need to add your width 100% to both the outer and inner table. The outer table has a width set to 1028px.

Upvotes: 2

KatieK
KatieK

Reputation: 13853

The problem is with the table that is the parent of the one you posted code for.

<table width="1028px" cellpadding="0" cellspacing="0" align="center">

Its width is set to 1028px, not 100%. Set it instead to 100%.

<table width="100%" cellspacing="0" cellpadding="0" border="0" bgcolor="#cacaca" align="center">

Upvotes: 1

bpeterson76
bpeterson76

Reputation: 12870

Because we can't see your HTML (only generated HTML) there's no way to debug your problem. According to the rendered HTML, you have a width set to 1028px.

Tables aren't a good fit at all for page layout. You should be attacking this particular problem with CSS -- Divs specifically.

Upvotes: 1

Related Questions