Class TableCells

All Implemented Interfaces:
Serializable, Cloneable, Iterable<TableCell>, Collection<TableCell>, List<TableCell>, RandomAccess, SequencedCollection<TableCell>

public class TableCells extends ArrayList<TableCell>
A specialized collection for managing HTML table cell elements.

This class extends ArrayList to provide type-safe storage and manipulation of TableCell objects. It serves as a convenient container for managing collections of table cells (<td> and <th> elements), offering all the functionality of an ArrayList while ensuring type safety for table cell operations.

Features:

  • Type-safe collection specifically for TableCell objects
  • Inherits all ArrayList functionality (add, remove, iterate, etc.)
  • Provides convenient storage for groups of table cells
  • Useful for programmatic table generation and manipulation
  • Supports both data cells (<td>) and header cells (<th>)

Usage:


 // Create a collection of table cells
 TableCells cells = new TableCells();

 // Add cells to the collection
 cells.add(new Td("Cell 1"));
 cells.add(new Td("Cell 2"));
 cells.add(new Th("Header"));

 // Iterate over cells
 for (TableCell cell : cells) {
     cell.setBackgroundColor("#f0f0f0");
 }

 // Use in table row construction
 Tr row = new Tr();
 for (TableCell cell : cells) {
     row.addElement(cell);
 }
 
Since:
2007
Version:
1.0
Author:
Marvin P. Warble Jr.
See Also:
  • Constructor Details

    • TableCells

      public TableCells()