# [web] Table position

## Recommended Posts

Hi Guys. Web development is really not one of my strong points. And was looking for some help. I have the following code, which draws, the header, a table, and then the footer.
<?php
?>

<div id="container">
<div id="content">

<table border="1" style="width:100%;">
<td style="width:100%;">
<div style="overflow:auto; height:600px">

<?php
for($counter = 10;$counter <= 5; \$counter += 1)
{
echo "<p>blah blah blah </p>";
}
?>

</div>
</td>
</table>

</div>
</div>

<?php
require ("footer.php");
?>


But the size of the table has a predefined size. What im looking for, is a way to say. - Draw Header - Draw a table, starting 25px at the bottom of the header, and ending 25px above the top of footer - Draw Footer How would i go about doing this? Ive been playing with positions, such as absolute, and fixed, but they always start at the top of the page, rather than underneath the header. thanks for reading

##### Share on other sites
You could give your table a margin-top and margin-bottom of 25px.

If, however, you want the footer to snap to the bottom of the viewport or bottom of the content (whichever's tallest) and have the table stretch to fill the available space (minus the margins) - "good luck". [wink]

## Create an account

Register a new account

• ### Forum Statistics

• Total Topics
628375
• Total Posts
2982319

• 10
• 9
• 14
• 24
• 11