You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/advanced_parameters.md
+39-8Lines changed: 39 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -62,6 +62,8 @@ Note: you can change the default value of the dom option by setting `opt.dom` as
62
62
Select [how many entries](https://datatables.net/examples/advanced_init/length_menu.html) should appear at once in the table with either the `lengthMenu` argument of the `show` function, or with the global option `itables.options.lengthMenu`:
In the context of the notebook, a horizontal scroll bar should appear when the table is too wide. In other contexts like here in Jupyter Book, you might want to use `scrollX = True`.
94
+
90
95
## Table and cell style
91
96
97
+
### Datatable classes
98
+
92
99
Select how your table should look like with the `classes` argument of the `show` function, or by changing `itables.options.classes`. For the list of possible values, see [datatables' default style](https://datatables.net/manual/styling/classes) and [the style examples](https://datatables.net/examples/styling/).
93
100
94
101
```{code-cell}
102
+
:tags: [full-width]
103
+
104
+
opt.scrollX = True
95
105
opt.classes = ["display", "nowrap"]
96
106
df
97
107
```
98
108
99
109
```{code-cell}
110
+
:tags: [full-width]
111
+
100
112
opt.classes = ["display", "cell-border"]
101
113
df
102
114
```
103
115
116
+
### Table position and width
117
+
118
+
You can set the `width` of a particular table, or center it by adding `margin:auto` to the `style` argument:
119
+
120
+
```{code-cell}
121
+
:tags: [full-width]
122
+
123
+
opt.scrollX = False
124
+
125
+
show(df, style="width:80%; margin:auto;")
126
+
```
127
+
104
128
## Table captions
105
129
106
130
You can set additional `tags` like a [caption](https://datatables.net/blog/2014-11-07) on the table with the `tags` option:
107
131
108
132
```{code-cell}
133
+
:tags: [full-width]
134
+
109
135
show(df, tags="<caption>Countries from the World Bank Database</caption>")
110
136
```
111
137
112
138
The position of the caption can be set explicitly as in the datatables example above (note that the default position may depend on how you render the notebook):
113
139
114
140
```{code-cell}
141
+
:tags: [full-width]
142
+
115
143
show(
116
144
df,
117
145
tags='<caption style="caption-side: top">Countries from the World Bank Database</caption>',
Copy file name to clipboardExpand all lines: docs/changelog.md
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,13 @@
1
1
ITables ChangeLog
2
2
=================
3
3
4
+
1.3.4 (2022-11-07)
5
+
------------------
6
+
7
+
**Fixed**
8
+
- We have removed `scrollX = True` which was causing issues with non-wide tables ([#110](https://github.com/mwouts/itables/issues/110)). Instead, we now use `style = "width:auto"`.
After this, any Pandas object (DataFrame or Series) is displayed as an interactive [datatables.net](https://datatables.net/) table, which lets you explore, filter or sort your data.
0 commit comments