render.table
render.table(self,
=None,
_fn*,
=False,
index='table shiny-table w-auto',
classes=0,
border**kwargs,
)
Reactively render a pandas DataFrame
object (or similar) as a basic HTML table.
Consider using data_frame instead of this renderer, as it provides high performance virtual scrolling, built-in filtering and sorting, and a better default appearance. This renderer may still be helpful if you use pandas styling features that are not currently supported by data_frame.
Parameters
index : bool = False
-
Whether to print index (row) labels. (Ignored for pandas
Styler
objects; callstyle.hide(axis="index")
from user code instead.) classes : str = 'table shiny-table w-auto'
-
CSS classes (space separated) to apply to the resulting table. By default, we use
table shiny-table w-auto
which is designed to look reasonable with Bootstrap 5. (Ignored for pandasStyler
objects; callstyle.set_table_attributes('class="dataframe table shiny-table w-auto"')
from user code instead.) ****kwargs** :
object
= {}-
Additional keyword arguments passed to
pandas.DataFrame.to_html()
orpandas.io.formats.style.Styler.to_html()
.
Returns
:
-
A decorator for a function that returns any of the following: 1. A pandas
DataFrame
object. 2. A pandasStyler
object. 3. Any object that has a.to_pandas()
method (e.g., a Polars data frame or Arrow table).
Tip
The name of the decorated function (or @output(id=...)
) should match the id
of a output_table container (see output_table for example usage).
See Also
- output_table for the corresponding UI component to this render function.