| calcite_table | R Documentation |
Creates a table component from a data.frame with automatic row and cell generation. The table provides pagination, numbering, and various styling options.
calcite_table(
data,
...,
id = NULL,
caption,
header = NULL,
alignment = "start",
bordered = NULL,
numbered = NULL,
page_size = NULL,
scale = NULL,
striped = NULL,
numbering_system = NULL
)
data |
A data.frame to display in the table (required) |
... |
Additional attributes passed to the component |
id |
Component ID (required for Shiny reactivity) |
caption |
Accessible title for the table (required) |
header |
Custom header row created with |
alignment |
Alignment for all cells: "start", "center", or "end" (default: "start") |
bordered |
When TRUE, displays borders (default: FALSE) |
numbered |
When TRUE, displays row numbers (default: FALSE) |
page_size |
Page size for pagination. When > 0, renders pagination controls (default: 0) |
scale |
Size of the component: "s" (small), "m" (medium), or "l" (large) (default: "m") |
striped |
When TRUE, displays striped styling (default: FALSE) |
numbering_system |
Unicode numeral system: "arab", "arabext", or "latn" |
The table emits events for page changes and selection changes (when selection is enabled).
Available properties in input$id:
$pageSize - Current page size
$scale - Component scale
$bordered - Whether borders are displayed
$numbered - Whether row numbers are displayed
$striped - Whether striped styling is applied
Other component properties
Events:
calciteTablePageChange - Fires when the page changes
An object of class calcite_component
# Basic table from data frame
calcite_table(
data = mtcars[1:5, 1:4],
id = "my_table",
caption = "Motor Trend Car Data",
bordered = TRUE,
striped = TRUE
)
# Table with pagination
calcite_table(
data = iris,
id = "iris_table",
caption = "Iris Dataset",
page_size = 10,
numbered = TRUE
)
# Table with custom headers
calcite_table(
data = mtcars[1:5, 1:3],
caption = "Cars",
header = list(
calcite_table_header(heading = "Miles/Gallon", description = "Fuel efficiency"),
calcite_table_header(heading = "Cylinders", description = "Number of cylinders"),
calcite_table_header(heading = "Displacement", description = "Engine size")
)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.