Getting table size

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Leo Smith
    New Member
    • Mar 2007
    • 45

    #1

    Getting table size

    I am trying to center a table in my browser window. I find that if I let the table size itself that I can't find out what its size is. I have no problems getting the dimensions of the window itself but style.width and style.height are not usable unless they are set. Is there something like innerWidth for a table or other controls? I also need to know the variations in browsers, specifically IE (6 or later) and Firefox (Mac and Windows).

    Thanks,
    Leo
  • iam_clint
    Recognized Expert Top Contributor
    • Jul 2006
    • 1207

    #2
    you can mess with offsetWidth and offsetHeight

    Comment

    • Leo Smith
      New Member
      • Mar 2007
      • 45

      #3
      Thanks, that looks like it might work. How is compatibility across browsers?

      Leo

      Comment

      • mrhoo
        Contributor
        • Jun 2006
        • 428

        #4
        If you want it horizontally centered, use css:
        table{margin:1e m auto 1em auto}

        Comment

        • iam_clint
          Recognized Expert Top Contributor
          • Jul 2006
          • 1207

          #5
          and heres mrhoo to save the day once again



          didn't even think to mention css

          Comment

          Working...