table

They have: 11 posts

Joined: Jun 2001

this is a stupid question but it has slipped my mind

how do i align a table in the center
both vertically and horizontally
on any browser size?

thanks

http://mirby.cjb.net
increasing it efficiency
through education, automation, and innnovation

Megan's picture

She has: 11,421 posts

Joined: Jun 1999

To align it both vertically and horizontally you have to enclose your table in a larger table with width and height set to 100%. So your code would look something like this:

<table border=0 width=100% height=100%>
<tr>
<td align=center> This should center vertically by default
<table><tr><td>
This is your content table
</td></tr></table>
</td>
</tr>
</table>
'

merlin's picture

They have: 410 posts

Joined: Oct 1999

i think 'heigth=100%' wouldn't work? or is this possible in new browser-versions?

Megan's picture

She has: 11,421 posts

Joined: Jun 1999

Quote: Originally posted by merlin
i think 'heigth=100%' wouldn't work? or is this possible in new browser-versions?

Well no, heigth=100% would never work Smiling. height=100% does work though - at least in the 4.x versions. I've used it on a couple of sites. Good way to do splash pages.

merlin's picture

They have: 410 posts

Joined: Oct 1999

oups, typo!
probably that's why it never worked... Smiling

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.