Class Td


@Marshalled(typeName="td") public class Td extends HtmlElementMixed<Td>
DTO for an HTML <td> element.

The td element represents a data cell in a table. It is used to contain the actual data content of a table row, as opposed to header cells (th) which contain column or row headers. The td element can contain any flow content and supports attributes for spanning multiple columns or rows, as well as associating with header cells for accessibility.

Examples:

import static org.apache.juneau.bean.html5.HtmlBuilder.*; // Simple data cell Td simple = td("John Doe"); // Data cell with styling Td styled = td("Important Data") .class_("highlight"); // Data cell spanning multiple columns Td colspan = td("Spans 2 columns") .colspan(2); // Data cell spanning multiple rows Td rowspan = td("Spans 3 rows") .rowspan(3); // Data cell with headers association Td headers = td("25") .headers("name-header age-header"); // Data cell with complex content Td complex = td( strong("Bold text"), " and ", em("italic text") );

See Also:
  • Constructor Details

    • Td

      public Td()
      Creates an empty Td element.
    • Td

      public Td(Object... children)
      Creates a Td element with the specified child nodes.
      Parameters:
      children - The child nodes. Must not be null.
  • Method Details

    • colspan

      public Td colspan(Object value)
      colspan attribute.

      Number of columns that the cell is to span.

      Parameters:
      value - The new value for this attribute. Typically a Number or String. Can be null to unset the attribute.
      Returns:
      This object.
    • headers

      public Td headers(String value)
      headers attribute.

      Specifies the IDs of header cells that apply to this table cell. This creates a programmatic relationship between the cell and its headers for accessibility purposes.

      Multiple IDs can be specified as a space-separated list.

      Parameters:
      value - The IDs of header cells that apply to this cell. Can be null to unset the attribute.
      Returns:
      This object.
    • rowspan

      public Td rowspan(Object value)
      rowspan attribute.

      Number of rows that the cell is to span.

      Parameters:
      value - The new value for this attribute. Typically a Number or String. Can be null to unset the attribute.
      Returns:
      This object.