Enum Class TableHeaderCell.Scope

java.lang.Object
java.lang.Enum<TableHeaderCell.Scope>
com.vaadin.flow.component.html.TableHeaderCell.Scope
All Implemented Interfaces:
Serializable, Comparable<TableHeaderCell.Scope>, Constable
Enclosing class:
TableHeaderCell

public static enum TableHeaderCell.Scope extends Enum<TableHeaderCell.Scope>
Defines the cells that a <th> header relates to ? effectively the answer to "which other cells does this header label?". Setting it correctly is what lets a screen reader read out the right column or row header when a user navigates into a data cell.

If no scope is set (or the value is unrecognized), browsers automatically infer the scope from the table structure. Per the HTML spec, the standard keywords are row, col, rowgroup, and colgroup; auto writes the literal "auto" attribute value, which browsers treat the same as omitting the attribute.

  • Enum Constant Details

    • ROW

      public static final TableHeaderCell.Scope ROW
      The header relates to all cells of the row it belongs to. Use this for a leading <th> that labels its row (e.g. the row's name or category).
    • COL

      public static final TableHeaderCell.Scope COL
      The header relates to all cells of the column it belongs to. Use this for a header at the top of a column (the most common case in <thead>).
    • ROWGROUP

      public static final TableHeaderCell.Scope ROWGROUP
      The header belongs to a row group (<tbody> or <thead>/<tfoot>) and relates to all cells in that group.
    • COLGROUP

      public static final TableHeaderCell.Scope COLGROUP
      The header belongs to a column group (TableColumnGroup) and relates to all cells in that group.
    • AUTO

      public static final TableHeaderCell.Scope AUTO
      Writes the literal "auto" value. Behaves the same as leaving the attribute unset ? the browser infers the scope from the table structure.
  • Method Details

    • values

      public static TableHeaderCell.Scope[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static TableHeaderCell.Scope valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getValue

      public String getValue()
      Returns the attribute value as it appears in the rendered HTML.
      Returns:
      the scope attribute value.