XHTML - centering a table?

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

    XHTML - centering a table?

    hello,

    i see that <table align="center"i s no longer valid markup in XHTML.
    nor is <center><table> </table></center>.

    how then does one center a table?

    found articles for centering text:



    ....but that doesnt help on a table because i dont want the text
    *inside* the table centered, only the table itself.


    surely this most be a common task?


    thanks!
    sm
  • Nick Theodorakis

    #2
    Re: XHTML - centering a table?

    On Feb 14, 1:31 pm, SpaceMarine <spacemar...@ma ilinator.comwro te:
    hello,
    >
    i see that <table align="center"i s no longer valid markup in XHTML.
    nor is <center><table> </table></center>.
    >
    how then does one center a table?
    >
    Set the left and right margins of the table to "auto" in your style
    sheet.

    Nick

    --
    Nick Theodorakis
    nick_theodoraki s@hotmail.com
    contact form:

    Comment

    • C A Upsdell

      #3
      Re: XHTML - centering a table?

      Nick Theodorakis wrote:
      On Feb 14, 1:31 pm, SpaceMarine <spacemar...@ma ilinator.comwro te:
      >hello,
      >>
      >i see that <table align="center"i s no longer valid markup in XHTML.
      >nor is <center><table> </table></center>.
      >>
      >how then does one center a table?
      >>
      >
      Set the left and right margins of the table to "auto" in your style
      sheet.
      Which will not work with older versions of IE still being used, so you
      may have to handle that.

      Comment

      • Jukka K. Korpela

        #4
        Re: XHTML - centering a table?

        Scripsit SpaceMarine:
        i see that <table align="center"i s no longer valid markup in XHTML.
        It is.
        nor is <center><table> </table></center>.
        It is.

        You don't really know what XHTML is, do you? Don't worry, most other
        authors who use XHTML don't know that either. But you might draw the
        conclusions and upgrade to HTML 4.01, which is far better supported by
        current browsers.
        how then does one center a table?
        There are ways to do that in CSS (consider checking the FAQs), but why
        bother, if you already know the HTML way?
        surely this most be a common task?
        It's not. Why would you want to center a table?

        --
        Jukka K. Korpela ("Yucca")


        Comment

        • Nick Theodorakis

          #5
          Re: XHTML - centering a table?

          On Feb 14, 2:20 pm, C A Upsdell <cupsd...@upsde ll.invalidwrote :
          Nick Theodorakis wrote:
          On Feb 14, 1:31 pm, SpaceMarine <spacemar...@ma ilinator.comwro te:
          hello,
          >
          i see that <table align="center"i s no longer valid markup in XHTML.
          nor is <center><table> </table></center>.
          >
          how then does one center a table?
          >
          Set the left and right margins of the table to "auto" in your style
          sheet.
          >
          Which will not work with older versions of IE still being used, so you
          may have to handle that.
          It'll work with IE down to version 6 as long as standards mode is
          invoked (and it needs to be invoked even to get it work with IE7). If
          the OP wants to make it work with IE5 (and even Netscape 4) I still
          have my old table centering page up:

          <http://theodorakis.net/tablecentertest .html>

          Although I felt a little hesitant to plug it in my other post.

          Nick

          --
          Nick Theodorakis
          nick_theodoraki s@hotmail.com
          contact form:

          Comment

          • SpaceMarine

            #6
            Re: XHTML - centering a table?

            On Feb 14, 2:09 pm, "Jukka K. Korpela" <jkorp...@cs.tu t.fiwrote:
            Scripsit SpaceMarine:
            >
            i see that <table align="center"i s no longer valid markup in XHTML.
            >
            It is.
            >
            nor is <center><table> </table></center>.
            >
            It is.
            not according to my XHTML 1.0 Transitional validation tool (Visual
            Studio 2005) -- "...is considered outdated. A newer construct is
            recommended."

            There are ways to do that in CSS (consider checking the FAQs),
            im asking here.

            surely this most be a common task?
            >
            It's not. Why would you want to center a table?
            who are you to question why i want to center a table?

            are you always such a useless fart-bubble twit? or just online?


            sm

            Comment

            • SpaceMarine

              #7
              Re: XHTML - centering a table?

              On Feb 14, 3:37 pm, Nick Theodorakis <nick.theodora. ..@gmail.com>
              wrote:
              It'll work with IE down to version 6 as long as standards mode is
              invoked (and it needs to be invoked even to get it work with IE7). If
              the OP wants to make it work with IE5 (and even Netscape 4) I still
              have my old table centering page up:
              >
              <http://theodorakis.net/tablecentertest .html>
              very useful, thanks nick.

              sm

              Comment

              • SpaceMarine

                #8
                Re: XHTML - centering a table?

                On Feb 14, 2:09 pm, "Jukka K. Korpela" <jkorp...@cs.tu t.fiwrote:
                There are ways to do that in CSS (consider checking the FAQs), but why
                bother, if you already know the HTML way?
                ps, Twit Master 3000 -- it is better to define layout in CSS over HTML
                anyway, as it lets the style doc render the content dynamically based
                on what the current medium is. for instance, my project uses one set
                of CSS docs for web browsers, and another for handhelds. prefer not to
                "hard code" the alignments in HTML even if they were standards-
                compliant tags, which i dont think they are any longer (see above).

                but, i found my solution, thanks to nick. im outtie. ta!


                sm

                Comment

                Working...