<table>: rows with differing number of columns

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

    <table>: rows with differing number of columns

    Hello,

    I would like to know whether having a <table> element with two <tr> elements
    each containing one <td> elements and two <td> elements, respectively, is
    legal from the point of view of standard W3C HTML/XHTML. In particular,
    is it legal for table rows to contain differing number of columns,
    even when the colspan attribute is not used?

    Thanks,

    Neil
  • Ben M

    #2
    Re: &lt;table&gt ;: rows with differing number of columns

    > Hello,[color=blue]
    >
    > I would like to know whether having a <table> element with two <tr>
    > elements each containing one <td> elements and two <td> elements,
    > respectively, is legal from the point of view of standard W3C
    > HTML/XHTML. In particular,
    > is it legal for table rows to contain differing number of columns,
    > even when the colspan attribute is not used?[/color]

    yes it is legal,

    The HTML 4.01 spec states that with respect to calculating the maximum
    number of columns in the table,

    "if the TABLE element contains no COLGROUP or COL elements, user agents
    should base the number of columns on what is required by the rows. The
    number of columns is equal to the number of columns required by the row with
    the most columns, including cells that span multiple columns. For any row
    that has fewer than this number of columns, the end of that row should be
    padded with empty cells. The "end" of a row depends on the table
    directionality. "

    --
    BenM



    Comment

    • Ben M

      #3
      Re: &lt;table&gt ;: rows with differing number of columns

      >> Hello,[color=blue][color=green]
      >>
      >> I would like to know whether having a <table> element with two <tr>
      >> elements each containing one <td> elements and two <td> elements,
      >> respectively, is legal from the point of view of standard W3C
      >> HTML/XHTML. In particular,
      >> is it legal for table rows to contain differing number of columns,
      >> even when the colspan attribute is not used?[/color]
      >
      > yes it is legal,
      >
      > The HTML 4.01 spec states that with respect to calculating the maximum
      > number of columns in the table,
      >
      > "if the TABLE element contains no COLGROUP or COL elements, user
      > agents should base the number of columns on what is required by the
      > rows. The number of columns is equal to the number of columns
      > required by the row with the most columns, including cells that span
      > multiple columns. For any row that has fewer than this number of
      > columns, the end of that row should be padded with empty cells. The
      > "end" of a row depends on the table directionality. "[/color]
      see http://www.w3.org/TR/html401/struct/...tml#h-11.2.4.3 for the
      source

      --
      BenM



      Comment

      Working...