---
title: "Table functions"
description: "Reference for the `dash_ag_grid` callable in `vizro.tables`, passed to a `Table` component's `figure` argument."
source_url: "https://vizro.readthedocs.io/en/stable/pages/API-reference/table-callables/"
agent_docs: "Index: https://vizro.readthedocs.io/en/stable/llms.txt; full documentation: https://vizro.readthedocs.io/en/stable/llms-full.txt"
---

# Table functions

## vizro.tables

Built-in table functions.

Usage documentation

[How to use tables](https://vizro.readthedocs.io/en/stable/pages/user-guides/table/)

### dash\_ag\_grid

```python
dash_ag_grid(
    data_frame: DataFrame, **kwargs: Any
) -> AgGrid
```

Implementation of `dash_ag_grid.AgGrid` with sensible defaults to be used in [`Table`](https://vizro.readthedocs.io/en/stable/pages/API-reference/models/#vizro.models.Table "            Table


  
      pydantic-model
  ").

Usage documentation

[How to use AG Grid](https://vizro.readthedocs.io/en/stable/pages/user-guides/table/#ag-grid)

| PARAMETER | DESCRIPTION |
| --- | --- |
| `data_frame` | DataFrame containing the data to be displayed.  **TYPE:** `DataFrame` |

| PARAMETER | DESCRIPTION |
| --- | --- |
| `**kwargs` | Additional keyword arguments to be passed to the `dash_ag_grid.AgGrid` component.  **TYPE:** `Any` |

| RETURNS | DESCRIPTION |
| --- | --- |
| `AgGrid` | A `dash_ag_grid.AgGrid` component with sensible defaults. |

Example

```python
import vizro.models as vm
from vizro.tables import dash_ag_grid

vm.Table(figure=dash_ag_grid(...))
```


Source code in `src/vizro/tables/_dash_ag_grid.py`

|  |  |
| --- | --- |
| ```  51  52  53  54  55  56  57  58  59  60  61  62  63  64  65  66  67  68  69  70  71  72  73  74  75  76  77  78  79  80  81  82  83  84  85  86  87  88  89  90  91  92  93  94  95  96  97  98  99 100 ``` | ``` @capture("ag_grid") def dash_ag_grid(data_frame: pd.DataFrame, **kwargs: Any) -> dag.AgGrid:     """Implementation of `dash_ag_grid.AgGrid` with sensible defaults to be used in [`Table`][vizro.models.Table].      Abstract: Usage documentation         [How to use AG Grid](../user-guides/table.md#ag-grid)      Args:         data_frame: DataFrame containing the data to be displayed.      Keyword Arguments:         **kwargs: Additional keyword arguments to be passed to the `dash_ag_grid.AgGrid` component.      Returns:         A `dash_ag_grid.AgGrid` component with sensible defaults.      Example:         ```python         import vizro.models as vm         from vizro.tables import dash_ag_grid          vm.Table(figure=dash_ag_grid(...))         ```     """     defaults = {         "className": "ag-theme-vizro",         "columnDefs": [{"field": col} for col in data_frame.columns],         "rowData": data_frame.to_dict(orient="records"),         "defaultColDef": {             "resizable": True,             "sortable": True,             "filter": True,             "filterParams": {                 "buttons": ["apply", "reset"],                 "closeOnApply": True,             },         },         "dashGridOptions": {             "dataTypeDefinitions": _DATA_TYPE_DEFINITIONS,             "animateRows": False,             "domLayout": "autoHeight",             "pagination": True,             "paginationPageSize": 20,             "theme": {"function": "vizroTheme(themeQuartz, agGrid)"},         },         "columnSize": "responsiveSizeToFit",     }     kwargs = _set_defaults_nested(kwargs, defaults)      return dag.AgGrid(**kwargs) ``` |
