View Full Version : tables and centering


armsocks
06-15-2003, 02:48 AM
I have 2 questions. I already asked one in the "Html help" section, but didn't get very much guidance out of that. So I'll try again.

Firstly, I would like to put a scrollbar inside one of my table cells. How do I do this, and where exactly does the code for it go?
Someone gave me this code and said I could put an "overflowing div layer" on the page (whatever that is):

<div style="position:absolute; top:#px; left:#px; width:#px; height:#px; overflow:auto; z-index:#">
</div>

I don't even know where to put this in order to make it work. If someone would like to help me out, I can give you my page address to show you what I need help with.

My second question is: how do you center a table so that it doesn't look whacked on someone else's screen? All I did was put <br><br><br> to keep it from being at the very top. And if you have an answer, please tell me where I put the code for this.

Alcy
06-15-2003, 10:26 PM
Since it's going to be in a table, you don't have to worry about positioning the DIV. Just add it inside one of your cells, like you would with normal text.

<table>
<tr>
<td>
<div style="width:#px; height:#px; overflow:auto;">
</div>
</td>
</tr>
</table>


To center your table on the page, you could nest your table inside another one.

<table align="center" width="100%">
<tr>
<td valign="middle">

FIRST TABLE HERE

</td>
</tr>
</table>