Table()
Creates a Material Design data table with optional striping, hover highlighting, and responsive horizontal scrolling.
Syntax
Result = MaterialSB::Table(Title.s, Flags = #Table_Default, Parent = #Null)
Parameters
| Title.s | The text for the first column header. |
| Flags | Optional. Combination of table flags for styling. |
| Parent | Optional. Parent element. If #Null, uses the current parent from the stack. |
Flags
| Flag | Description |
|---|---|
#Table_Default | Standard table styling (default) |
#Table_Striped | Alternating row background colors |
#Table_Highlight | Highlight rows on hover |
#Table_Centered | Center-align all text |
#Table_Responsive | Enable horizontal scrolling on small screens |
Return Value
Returns the table element. Use this reference for adding columns and rows.
Remarks
Tables are created with a header row containing the first column. Use TableAddColumn() to add more columns to the header, then TableAddItem() to add data rows.
When adding items, separate column values with newlines (Chr(10) or ~"\n").
Example
Procedure Main(Success)
If Success
MaterialSB::Row(MaterialSB::#Grid_Container)
MaterialSB::Col(12)
; Create a striped, highlighted table
myTable = MaterialSB::Table("Name", MaterialSB::#Table_Striped | MaterialSB::#Table_Highlight | MaterialSB::#Table_Responsive)
; Add column headers
MaterialSB::TableAddColumn("Email", myTable)
MaterialSB::TableAddColumn("Role", myTable)
MaterialSB::TableAddColumn("Status", myTable)
; Add data rows (columns separated by newlines)
MaterialSB::TableAddItem("John Doe" + Chr(10) + "john@example.com" + Chr(10) + "Admin" + Chr(10) + "Active", myTable)
MaterialSB::TableAddItem("Jane Smith" + Chr(10) + "jane@example.com" + Chr(10) + "Editor" + Chr(10) + "Active", myTable)
MaterialSB::TableAddItem("Bob Wilson" + Chr(10) + "bob@example.com" + Chr(10) + "Viewer" + Chr(10) + "Inactive", myTable)
MaterialSB::CloseCurrentParent()
MaterialSB::CloseCurrentParent()
EndIf
EndProcedure
MaterialSB::Download(@Main())