[Gllug] [OT?] Please sign my Google petition ...

Daniel P. Berrange dan at berrange.com
Wed Jun 9 10:40:43 UTC 2004


On Wed, Jun 09, 2004 at 11:34:34AM +0100, Tethys wrote:
> 
> "Daniel P. Berrange" writes:
> 
> >Transitional & Frameset (oth HTML 4 & XHTML versions) are the things
> >to really avoid.
> 
> So tell me how to get a centred table in Strict. That's the only thing I
> still use Transitional for. If you try:


> Anyone know how I can do this properly?

Eric Meyer's book showed the lowdown on this:

  <table id="mytable">
  </table>


#mytable {
  width: 60%;
  margin-left: auto;
  margin-right: auto;
}

With both margins set to auto the browser (if compliant) will
set them both the same value thus centering the element. This
works in IE 6 & Mozilla, but not Nutscrape & IE <= 5.5

IIRC, there may also be some caveat about the element you are
centering needing to be within a positioned element. ie one
that has an explicit 'position:' attribute set - but thats no
too difficult to deal with - since soo many things in CSS work
better if you use position tags.

Dan
-- 
|=-            GPG key: http://www.berrange.com/~dan/gpgkey.txt       -=|
|=-       Perl modules: http://search.cpan.org/~danberr/              -=|
|=-           Projects: http://freshmeat.net/~danielpb/               -=|
|=-   berrange at redhat.com  -  Daniel Berrange  -  dan at berrange.com    -=|
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 240 bytes
Desc: not available
URL: <http://mailman.lug.org.uk/pipermail/gllug/attachments/20040609/e3f072fe/attachment.pgp>
-------------- next part --------------
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug


More information about the GLLUG mailing list