ColGroup in Mozilla?

Discussion in 'HTML' started by Martin, Aug 26, 2004.

  1. Martin

    Martin Guest

    I'm using the following in a table. It works as expected in IE but in
    Mozilla (Linux), the cell contents are not centered. If I move the
    "align='center'" to the <TD> tag, then it works in Mozilla.

    Shouldn't this work in both browsers? Am I doing something wrong?

    <colgroup>
    <col width='25%' align='center'>
    <col width='25%' align='center'>
    <col width='25%' align='center'>
    <col width='25%' align='center'>
    </colgroup>
     
    Martin, Aug 26, 2004
    #1
    1. Advertising

  2. Martin

    Mark Parnell Guest

    On Wed, 25 Aug 2004 19:59:24 -0700, Martin <>
    declared in alt.html:

    > Am I doing something wrong?


    Yes. align="" is deprecated. Use CSS.

    --
    Mark Parnell
    http://www.clarkecomputers.com.au
    "Never drink rum&coke whilst reading usenet" - rf 2004
     
    Mark Parnell, Aug 26, 2004
    #2
    1. Advertising

  3. Martin <> wrote:

    > I'm using the following in a table. It works as expected in IE but in
    > Mozilla (Linux), the cell contents are not centered. If I move the
    > "align='center'" to the <TD> tag, then it works in Mozilla.


    Mozilla, in at least some versions, simply does not support the
    align="..." attribute in <col> elements.

    > <colgroup>
    > <col width='25%' align='center'>
    > <col width='25%' align='center'>
    > <col width='25%' align='center'>
    > <col width='25%' align='center'>
    > </colgroup>


    Why <colgroup>? The width attributes suggest that these are the only
    columns, so there's little point in separating them from other columns
    into a group of their own.

    You can use style sheets to set the alignment. In this case, it seems to
    be easy, since you wish to center text lines in _all_ cells. If this is
    the only table on the page, you could make things as simple as

    <style type="text/css">
    td { text-align: center; }
    </style>

    This works nicely on Mozilla.

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
     
    Jukka K. Korpela, Aug 26, 2004
    #3
  4. Martin

    Spartanicus Guest

    Mark Parnell <> wrote:

    >Shouldn't this work in both browsers? Am I doing something wrong?
    >
    ><colgroup>
    ><col width='25%' align='center'>
    ><col width='25%' align='center'>
    ><col width='25%' align='center'>
    ><col width='25%' align='center'>
    ></colgroup>
    >
    >Yes. align="" is deprecated.


    Incorrect.

    --
    Spartanicus
     
    Spartanicus, Aug 26, 2004
    #4
  5. Martin

    Neal Guest

    On Thu, 26 Aug 2004 13:22:36 +1000, Mark Parnell
    <> wrote:

    > On Wed, 25 Aug 2004 19:59:24 -0700, Martin <>
    > declared in alt.html:
    >
    >> Am I doing something wrong?

    >
    > Yes. align="" is deprecated. Use CSS.
    >



    The attribute align is not deprecated when used on these elements: col,
    colgroup, tbody, td, tfoot, th, thead, tr.
     
    Neal, Aug 26, 2004
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Re: Colgroup Bug?

    , Feb 4, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    848
  2. Rob Meade

    <asp:table> and <colgroup> ?

    Rob Meade, Apr 19, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    4,176
    Eliyahu Goldin
    Apr 19, 2005
  3. Daniel Doman

    use of colgroup

    Daniel Doman, Jul 10, 2003, in forum: HTML
    Replies:
    0
    Views:
    516
    Daniel Doman
    Jul 10, 2003
  4. Daniel Doman

    use of colgroup

    Daniel Doman, Jul 10, 2003, in forum: HTML
    Replies:
    4
    Views:
    1,479
    Daniel Doman
    Jul 11, 2003
  5. Frank

    colgroup and css

    Frank, Oct 22, 2003, in forum: HTML
    Replies:
    5
    Views:
    25,429
Loading...

Share This Page