Class HTMLTable<T>
java.lang.Object
com.amalgamasimulation.desktop.html.HTMLTag
com.amalgamasimulation.desktop.html.tables.HTMLTable<T>
- Type Parameters:
T- the type of data in the table
- All Implemented Interfaces:
HTMLConvertable
- Direct Known Subclasses:
HTMLTableFromUITable
The HTMLTable class represents an HTML table that is generated from a list of
data values. It extends
HTMLTag and provides methods for configuring
and rendering tables with custom styles and columns.- Author:
- Alexey Glazyrin
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddBody()Adds table body (rows with data).Adds a column to the table with the specified value extractor and title.Converts the table to an HTML string.Methods inherited from class com.amalgamasimulation.desktop.html.HTMLTag
append, attr, backgroundColor, colorToRGBA, copy, fillCopy, font, fontColor, fontFamily, fontSizeInPx, fontStyle, fontWeight, getAttributes, getChildren, lineHeight, marginInPx, maxHeightInPx, maxWidthInPx, paddingInPx, relativeHeight, relativeWidth, removeChildren, style, tag, tag, textAlignment, toCSSMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.amalgamasimulation.desktop.html.HTMLConvertable
copy, toHTML
-
Field Details
-
trHead
-
tbody
-
columns
-
-
Constructor Details
-
HTMLTable
Constructs a new HTMLTable instance from a list of data values.- Parameters:
dataValues- the list of data values to display in the table
-
-
Method Details
-
column
Adds a column to the table with the specified value extractor and title.- Parameters:
extractor- a function to extract the cell value from the datatitle- the title of the column- Returns:
- the created
HTMLTableColumninstance
-
toHTML
Converts the table to an HTML string.- Specified by:
toHTMLin interfaceHTMLConvertable- Overrides:
toHTMLin classHTMLTag- Parameters:
outStrings- set of unique strings of text content- Returns:
- the HTML string representation of the table
-
addBody
protected void addBody()Adds table body (rows with data).
-