Centering tables

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Neil Mac

    Centering tables

    My test site: http://www.email48.freeserve.co.uk has two tables on the first
    page, try as I might I can't get them to center in Netscape 7- relative to
    the size of the screen (rather than absolutely).
    Now I know the arguments about not using tables but as I'm just starting out
    in css, I want to convert my existing pages rather than re-write the whole
    thing.
    I've read and re-read loads of sites and can't find a suitable property.
    Any help much appreciated

    Thanks

    Neil


    ---
    Outgoing mail is certified Virus Free.
    Checked by AVG anti-virus system (http://www.grisoft.com).
    Version: 6.0.502 / Virus Database: 300 - Release Date: 18-07-03


  • David Dorward

    #2
    Re: Centering tables

    Neil Mac wrote:
    [color=blue]
    > My test site: http://www.email48.freeserve.co.uk has two tables on the
    > first page, try as I might I can't get them to center in Netscape 7-[/color]



    --
    David Dorward http://david.us-lot.org/

    Comment

    • Neil Mac

      #3
      Re: Centering tables


      "David Dorward" <dorward@yahoo. com> wrote in message
      news:bfeg9u$e4k $2$830fa7a5@new s.demon.co.uk.. .[color=blue]
      > Neil Mac wrote:
      >[color=green]
      > > My test site: http://www.email48.freeserve.co.uk has two tables on the
      > > first page, try as I might I can't get them to center in Netscape 7-[/color]
      >
      > http://david.us-lot.org/www/centre/#block
      >
      > --
      > David Dorward http://david.us-lot.org/[/color]


      Fantastic - you've saved me from going hairless.
      Definitely a site to bookmark
      Thanks

      Neil



      ---
      Outgoing mail is certified Virus Free.
      Checked by AVG anti-virus system (http://www.grisoft.com).
      Version: 6.0.502 / Virus Database: 300 - Release Date: 18-07-03


      Comment

      • David Dorward

        #4
        Re: Centering tables

        Stan Brown wrote:[color=blue][color=green]
        >>http://david.us-lot.org/www/centre/#block[/color][/color]
        [color=blue]
        > There is at least one issue not addressed there: All your interior
        > cells will also be centered.[/color]

        Quote:
        The element then needs to have its own text-align reset to left.

        (and see the example).

        --
        David Dorward http://david.us-lot.org/

        Comment

        • Peter Collinson

          #5
          Re: Centering tables

          David Dorward <dorward@yahoo. com> suggests:
          [color=blue][color=green]
          > > My test site: http://www.email48.freeserve.co.uk
          > > has two tables on the first page, try as I might I
          > > can't get them to center in Netscape 7-[/color][/color]
          [color=blue]
          > http://david.us-lot.org/www/centre/#block[/color]

          Neat... except that it doesn't seem to work. I cut and pasted right off
          your page, and bagged the "text-align: center" approach in my external
          style sheet.

          h1, h2, h3, h4, h5 {
          margin-left: auto;
          margin-right: auto;
          }

          In every instance, the heads and sub-heads appear flush-left in IE6.0
          and Netscape 7.0.

          What did I misunderstand?

          --
          - Yours truly, Pete Collinson


          Comment

          • Knud Gert Ellentoft

            #6
            Re: Centering tables

            "Peter Collinson" <bluescat@opton line.net> skrev :
            [color=blue]
            >In every instance, the heads and sub-heads appear flush-left in IE6.0
            >and Netscape 7.0.
            >
            >What did I misunderstand?[/color]

            You must have a width on the element.

            h1, h2, h3, h4, h5 {
            margin-left: auto;
            margin-right: auto;
            width: 80%
            }
            --
            Knud

            Comment

            • David Dorward

              #7
              Re: Centering tables

              Peter Collinson wrote:
              [color=blue]
              > h1, h2, h3, h4, h5 {
              > margin-left: auto;
              > margin-right: auto;
              > }
              >
              > In every instance, the heads and sub-heads appear flush-left in IE6.0
              > and Netscape 7.0.[/color]

              Most likely the element is centred, but is taking up the whole width of the
              window, and the text inside the element is aligned to the left (which is
              the default).

              --
              David Dorward http://david.us-lot.org/

              Comment

              Working...