Welcome to WebmasterWorld Guest from

Forum Moderators: mack

Message Too Old, No Replies

Vertically align table

10:57 pm on Apr 10, 2009 (gmt 0)

New User

5+ Year Member

joined:Apr 8, 2009
posts: 2
votes: 0

Is there a way to vertically center a table? I don't want the content inside the table to be vertically centered (<td valign="middle">), but the entire table.

I know you can align the table width, like this:

<table width="700" height="700" border="0" align="center" cellpadding="0" cellspacing="0">
<td background="bground_trans.png">&nbsp;</td>

So is there a html code to vertically center the table also?

Thanks a lot

[edited by: eelixduppy at 5:35 pm (utc) on April 13, 2009]
[edit reason] disabled smileys [/edit]

1:43 am on Apr 11, 2009 (gmt 0)

Senior Member

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Nov 28, 2004
votes: 0

This was mentioned recently [webmasterworld.com] and one solution is Dead Centre [webmasterworld.com] originally posted here by SuzyUK.

FYI, valign="middle" is the default behavior of a table cell in most browsers, no need to specify it, and valign is also deprecated as is nowrap, width, and height.

10:06 pm on Apr 19, 2009 (gmt 0)

New User

5+ Year Member

joined:Apr 19, 2009
votes: 0

I would assume the best solution is to use css to control the padding/margin for the placement of the table within your webpage?