headers
, rows
, and footers
props. These props are used to create the table.Name | Age | Location |
---|---|---|
John | 30 | New York |
Jane | 31 | San Francisco |
Joe | 32 | Los Angeles |
Footer 1 | Footer 2 | Footer 3 |
rx.table_container(
rx.table(
headers=["Name", "Age", "Location"],
rows=[
("John", 30, "New York"),
("Jane", 31, "San Francisco"),
("Joe", 32, "Los Angeles"),
],
footers=["Footer 1", "Footer 2", "Footer 3"],
variant="striped",
)
)
Name | Age |
---|---|
John | 30 |
rx.table(
rx.thead(
rx.tr(
rx.th("Name"),
rx.th("Age"),
)
),
rx.tbody(
rx.tr(
rx.td("John"),
rx.td(30),
)
),
)
columns = ["Name", "Age", "Location"]
data = [
["John", 30, "New York"],
["Jane", 25, "San Francisco"],
]
footer = ["Footer 1", "Footer 2", "Footer 3"]
Name | Age | Location |
---|---|---|
John | 30 | New York |
Jane | 25 | San Francisco |
Footer 1 | Footer 2 | Footer 3 |
rx.table_container(
rx.table(
rx.table_caption("Example Table"),
rx.thead(
rx.tr(*[rx.th(column) for column in columns])
),
rx.tbody(
*[
rx.tr(*[rx.td(item) for item in row])
for row in data
]
),
rx.tfoot(rx.tr(*[rx.th(item) for item in footer])),
)
)
Name | Age | Location |
---|---|---|
John | 30 | New York |
Jane | 31 | San Francisco |
Joe | 32 | Los Angeles |
rx.table_container(
rx.table(
rx.thead(
rx.tr(
rx.th("Name"),
rx.th("Age"),
rx.th("Location"),
)
),
rx.tbody(
rx.tr(
rx.td("John"),
rx.td(30),
rx.td("New York"),
),
rx.tr(
rx.td("Jane"),
rx.td(31),
rx.td("San Francisco"),
),
rx.tr(
rx.td("Joe"),
rx.td(32),
rx.td("Los Angeles"),
),
),
variant="striped",
color_scheme="teal",
)
)
A table component.
A table header component.
A table body component.
A table footer component.
A table row component.
A table header cell component.
A table data cell component.
A table caption component.
The table container component renders a div that wraps the table component.