Centering HTML table within a CSS table.

liunx

Guest
How would i go about vertically centering an css table without distoring the html table inside.

example of problem (<!-- m --><a class="postlink" href="http://bellsouthpwp.net/l/a/lamppost/withcssvcenter.htm">http://bellsouthpwp.net/l/a/lamppost/withcssvcenter.htm</a><!-- m -->)
Unfortunatly when I made this page I forgot to take in account diffrent resolutions. So unless you are using 1280*1024 don't bother with the link above.Your positioning is totally screwed up in mozilla. May i suggest going with all-CSS?I would, but the table for the images is created by adobe imageready and they can get quite complex.Originally posted by swatpup32
I would, but the table for the images is created by adobe imageready and they can get quite complex. Also quite useless. That's just one image; it should BE just one image and it should probably just be the page background.Quite true for this page, but other pages contain many more slices with animations, rollovers and such, which would make it hard to get the same results just by using html. This page was just created as a sample.
Anyways how much editing would be required to turn the html table into a css table.It's not worth the time. Rote translation of tables to css do nothing for the semantic content of the site or the bandwith required to deliver it. Just leave it tables; css is not a "secret ingredient" that provides benefit just by its presence.Well if i kept in html the only way I could vertically center it would be to somehow enter the screen.height information from javascript into the <Table Height=> html property.uh, ever heard of valign?

<table>
<tr>
<td valign="center">blah</td>
</tr>
</table>I've come up with a CSS-only solution that works OK in most browsers.

It fully works in:

- Mozilla/ Netscape 7
- Firebird
- Firefox
- Opera 6.04

Works pretty good in:

- Opera 7.2 - It doesn't seem to support the min-height attribute for the html and body tags
- IE6, 5, 5.5/PC

Works OK in IE 4/PC

Doesn't work in...

guess which browser...

Netscape 4.x

The TXT file is below.
 
Back
Top