display property for colgroup

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Christopher Benson-Manica

    display property for colgroup

    I have the following markup and script:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    <title>test</title>
    <script type="text/javascript">
    function foo() {
    document.getEle mentById( 'foo' ).style.display ='none';
    }
    </script></head>
    <body>
    <table>
    <colgroup id="foo">
    <col>
    <colgroup id="bar">
    <col>
    <tr>
    <td>foo</td>
    <td>bar</td>
    </tr>
    <tr>
    <td>foo</td>
    <td>bar</td>
    </tr>
    </table>
    <div><input type="button" onclick="foo()" ></div>
    </body></html>

    It validates as 4.01 strict. The button is intended to hide the first
    column of the table when clicked. It does in fact do this in IE6, but
    not in NS 7.1 or Firefox. Am I making a mistake, or asking too much
    of the other UA's?

    --
    Christopher Benson-Manica | I *should* know what I'm talking about - if I
    ataru(at)cybers pace.org | don't, I need to know. Flames welcome.
  • Steve Pugh

    #2
    Re: display property for colgroup

    Christopher Benson-Manica <ataru@nospam.c yberspace.org> wrote:
    [color=blue]
    > function foo() {
    > document.getEle mentById( 'foo' ).style.display ='none';
    > }[/color]
    [color=blue]
    > <colgroup id="foo">[/color]
    [color=blue]
    >It validates as 4.01 strict. The button is intended to hide the first
    >column of the table when clicked. It does in fact do this in IE6, but
    >not in NS 7.1 or Firefox. Am I making a mistake, or asking too much
    >of the other UA's?[/color]

    See http://www.w3.org/TR/CSS21/tables.html#q4
    display does not apply to columns.

    Steve

    --
    "My theories appal you, my heresies outrage you,
    I never answer letters and you don't like my tie." - The Doctor

    Steve Pugh <steve@pugh.net > <http://steve.pugh.net/>

    Comment

    • Christopher Benson-Manica

      #3
      Re: display property for colgroup

      Steve Pugh <steve@pugh.net > wrote:
      [color=blue]
      > See http://www.w3.org/TR/CSS21/tables.html#q4
      > display does not apply to columns.[/color]

      Hm, thanks. It seems that visibility: collapse can accomplish
      something very similar to display: none - is that correct?

      --
      Christopher Benson-Manica | I *should* know what I'm talking about - if I
      ataru(at)cybers pace.org | don't, I need to know. Flames welcome.

      Comment

      Working...