Setting table column width?

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

    Setting table column width?

    Where col is a <colelement:

    col.style.width = "27px";

    works fine on Firefox but not on IE. How do you set a column width in IE?
    (If it matters, the <colis not one that was present in HTML, it was
    created in the Javascript.)

    --
    Tim Ward



  • Martin Honnen

    #2
    Re: Setting table column width?

    Tim Ward wrote:
    Where col is a <colelement:
    >
    col.style.width = "27px";
    >
    works fine on Firefox but not on IE. How do you set a column width in IE?
    col.width = "27"
    should work with Firefox, IE and other browsers.

    --

    Martin Honnen

    Comment

    • Tim Ward

      #3
      Re: Setting table column width?

      "Martin Honnen" <mahotrash@yaho o.dewrote in message
      news:48ce5691$0 $18736$9b4e6d93 @newsspool1.arc or-online.net...
      Tim Ward wrote:
      >Where col is a <colelement:
      >>
      >col.style.widt h = "27px";
      >>
      >works fine on Firefox but not on IE. How do you set a column width in IE?
      >
      col.width = "27"
      should work with Firefox, IE and other browsers.
      Like all the other things I've tried, it works with Firefox and not IE.

      --
      Tim Ward



      Comment

      • Thomas 'PointedEars' Lahn

        #4
        Re: Setting table column width?

        Tim Ward wrote:
        "Martin Honnen" <mahotrash@yaho o.dewrote [...]:
        >Tim Ward wrote:
        >>Where col is a <colelement:
        >>>
        >>col.style.wid th = "27px";
        >>>
        >>works fine on Firefox but not on IE. How do you set a column width in IE?
        > col.width = "27"
        >should work with Firefox, IE and other browsers.
        >
        Like all the other things I've tried, it works with Firefox and not IE.
        AFAIK, MSHTML does not support the `col' element for formatting table
        columns due to its non-standard box model.

        However, "Does not work" is a useless error description. [psf 4.11]


        PointedEars
        --
        Prototype.js was written by people who don't know javascript for people
        who don't know javascript. People who don't know javascript are not
        the best source of advice on designing systems that use javascript.
        -- Richard Cornford, cljs, <f806at$ail$1$8 300dec7@news.de mon.co.uk>

        Comment

        • Tim Ward

          #5
          Re: Setting table column width?

          "Thomas 'PointedEars' Lahn" <PointedEars@we b.dewrote in message
          news:48CEA369.7 070803@PointedE ars.de...
          AFAIK, MSHTML does not support the `col' element for formatting table
          columns due to its non-standard box model.
          Yeah, I've given up on using <tableand am setting out a table using <div>
          and <span>, then changing column widths by scripting the style sheet. That
          works.

          --
          Tim Ward



          Comment

          • Thomas 'PointedEars' Lahn

            #6
            Re: Setting table column width?

            Tim Ward wrote:
            "Thomas 'PointedEars' Lahn" <PointedEars@we b.dewrote [...]:
            >AFAIK, MSHTML does not support the `col' element for formatting table
            >columns due to its non-standard box model.
            >
            Yeah, I've given up on using <tableand am setting out a table using <div>
            and <span>, then changing column widths by scripting the style sheet. That
            works.
            It is the wrong approach, though, unless you do not have tabular data there.


            PointedEars
            --
            realism: HTML 4.01 Strict
            evangelism: XHTML 1.0 Strict
            madness: XHTML 1.1 as application/xhtml+xml
            -- Bjoern Hoehrmann

            Comment

            • Laser Lips

              #7
              Re: Setting table column width?

              On Sep 16, 2:30 pm, Thomas 'PointedEars' Lahn <PointedE...@we b.de>
              wrote:
              Tim Ward wrote:
              "Thomas 'PointedEars' Lahn" <PointedE...@we b.dewrote [...]:
              AFAIK, MSHTML does not support the `col' element for formatting table
              columns due to its non-standard box model.
              >
              Yeah, I've given up on using <tableand am setting out a table using <div>
              and <span>, then changing column widths by scripting the style sheet. That
              works.
              >
              It is the wrong approach, though, unless you do not have tabular data there.
              >
              PointedEars
              --
                  realism:    HTML 4.01 Strict
                  evangelism: XHTML 1.0 Strict
                  madness:    XHTML 1.1 as application/xhtml+xml
                                                                  -- Bjoern Hoehrmann
              Try using col.offsetWidth =27;

              Comment

              • Conrad Lender

                #8
                Re: Setting table column width?

                On 2008-09-16 16:43, Laser Lips wrote:
                Try using col.offsetWidth =27;
                Try it yourself, and tell us if it worked.
                Hint: offsetWidth is a readonly property.


                - Conrad

                Comment

                Working...