Skip to content

Commit

Permalink
Document the dom option
Browse files Browse the repository at this point in the history
  • Loading branch information
mwouts committed Jun 23, 2022
1 parent d1d366f commit 8752434
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
22 changes: 21 additions & 1 deletion docs/advanced_parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,34 @@ from itables.sample_dfs import get_countries
df = get_countries()
```

## Selecting table controls

Use DataTables' [`dom` option](https://datatables.net/reference/option/dom)
to select the elements of the table that should be displayed:
- `l`: length changing input control
- `f`: filtering input
- `t`: The table!
- `i`: Table information summary
- `p`: pagination control
- `r`: processing display element

For instance, if you don't want the search box, the length input control and the table summary, use

```{code-cell}
import pandas as pd
show(pd.DataFrame({"a": [2, 1]}), dom="tpr")
```

Note: you can change the default value of the dom option by setting `opt.dom` as in the examples below.

## Row sorting

Select the order in which the row are sorted with the [datatables' `order`](https://datatables.net/reference/option/order) argument. By default, the rows are sorted according to the first column (`order = [[0, 'asc']]`).

If you want to deactivate the sorting, set `order = []`, either in the `show` method, or as a global option:

```{code-cell}
import pandas as pd
import itables.options as opt
opt.order = [] # no sorting
Expand Down
1 change: 1 addition & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ ITables ChangeLog

**Added**
- `itables.options` and the `show` function have a new `column_filters` argument to display individual column search boxes ([#69](https://github.com/mwouts/jupytext/issues/69))
- We have documented DataTables' `dom` option.
- We have introduced a new class `JavascriptFunction` to limit the evaluation of Javascript function to selected ones.
- The documentation is formatted with `black` thanks to a Jupytext & Black pre-commit hook.

Expand Down

0 comments on commit 8752434

Please sign in to comment.