Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
hi,
I'm building a website and I'd like it to be centered in the middle of the window.
so I put the entire content in a table with one cell and I set that to align its content to the middle (<td valign="middle" align="center">)
this does the trick in firefox, but IE refuses to do it -_-'
horizontal alignment works, vertical alignment doesn't...
I've been trying lots of stuff, but none seem to work, and it shouldn't have to be complicated...
any ideas?
thx

Hi,
Not used tables in a while, so can't remember all the situations IE falls over with tables. The main reason i moved to CSS and divs.
If you wanted to try using CSS, a simple way would be to use this code. Copy and paste into Notepad or Notepad++ and save it as test.html or something with .html file extension.
<html>
<head>
<style type="text/css">
==replace this one line with explanation below 1==
body {
text-align: center;
}
#wrapper{
width: 720px;
margin: 0 auto;
text-align: left;
border: 2px solid;
}
==replace this one line with explanation below 2==
</style>
</head><body>
<div id="wrapper">
some text here</p>
</div>
</body>
</html>Annoyingly Computing.net wont allow all code you could add a
1.
left arrow (above comma), exclamation, dash, dash (next to plus/equals)
2.
dash, dash, exclamation, right box arrow (above full stop, or if your american a period.... which from an englishman's vocabulary is just really really wrong, there arn't many things i'd like to replace with a period!! :D )
The text align stuff in body and wrapper is for IE5 and IE6, as they dont work too well. I hate M$ they make so much work.
The border part is just to show you that it is centered. Take this out and make it your own. Its not to hard to find some tags and get going. If you wanted to progress try using the CSS keyword position with values fixed, relative, and float (float can be tricky though leave this when your not on a deadline to get this finished).Anyway, sorry i can't help you with tables but they really have gone the way of Dodo for precisely the reason you've posted here. They used to drive me up the wall too, best to just blame M$ and move on :-P
Hope this helps,
Adam

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |