How can I center a table vertically and horizonatally in Dreamweaver 8?


I am new to writing web design and I am having trouble making a table centered in the screen.  I have a table that is 1 x 1 and is 100% both height and width.  Inside of the table I have an image and have it centered in the table horizontally, but I am not sure on how to make it center vertically.  Any help is greatly appreciated.

Thank you.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jason C. LevineNo oneCommented:
Hi ryanbass,

Centering things vertically is a non-trivial undertaking and the exact method depends a bit on your existing code.

Can we see a link to the page, please?
ryanbassAuthor Commented:
Here is the code.  I am only working on the website locally right now.  I hope this will work.

Thanks for your help.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
    <td valign="middle"><div align="center"><img src="Images/ETLogoOnly.gif" width="303" height="374" alt="ET Video, INC" /></div></td>

Open in new window

Does your table actually stretch to 100% height? That's usually the challenge. If you've got that covered, you can use CSS to position the image. Relative positioning at 50% will put the top edge in the center, so compensate by subtracting a margin of 1/2 the image's height. E.G. If you have an image 100px high, you need a margin of -50px, as below:
img {position: relative; top: 50%; margin-top: -50px;}

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ryanbassAuthor Commented:
Sorry for the delay, but everything worked great.  Thanks for your help.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Adobe Dreamweaver

From novice to tech pro — start learning today.