Skip to content

Negative values and keywords for rowspan and colspan #13162

Open

Description

@Crissov

What is the issue with the HTML Standard?

Attributes common to td and th elements specifies colspan and rowspan values as integers with specific limits:

  • colspan: (0, 1000]
  • rowspan: [0, 65534]

    the value zero means that the cell is to span all the remaining rows in the row group.

While the quoted behavior is useful to have (though little known), accessing it by specifying 0 is as surprising as not having it for columns. A keyword would be better.
Also, there are cases where authors don’t want a cell to span the rest of the group but the whole table dimension – this violates the technical principle that spanned slots must be within the same row group (but may be in a different column group), though.

Proposal

  • Add the zero behavior to colspan as well.
  • Add the absolute keyword group (or separate rowgroup and colgroup) as an alias of 0.
  • Add the absolute keyword table, rest, all or * (at least to colspan), which makes the cell span all remaining slots within the row or column.
  • Add behavior for negative integers: the cell is spanned until the nth-last column or row of the table (or group?) unless the starting slot index is already this number or beyond.
    • As a corollary, the keyword from the previous bullet point becomes an alias of -1.
  • Add the absolute keyword cell (or separate row and col) as an alias of 1.
  • Add the relative keyword scope or auto which computes a value based on the value of the scope attribute:
    • scope rowspan colspan
      row ⇒ 1 or cell 0 or group
      col ⇒ 0 or group 1 or cell
      rowgroup ⇒ 0 or group -1 or all
      colgroup ⇒ -1 or all 0 or group

Activity

  1. changed the title [-]Let `rowspan` and `colspan` transparently span remaining slots[/-] on Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions