@@ -26,11 +26,14 @@ reactable(iris)
26
26
Columns can be customized by providing a named list of column definitions
27
27
created by ` colDef() ` to ` columns ` :
28
28
``` {r}
29
- reactable(iris[1:5, ], columns = list(
30
- Sepal.Length = colDef(name = "Sepal Length"),
31
- Sepal.Width = colDef(name = "Sepal Width"),
32
- Species = colDef(align = "center")
33
- ))
29
+ reactable(
30
+ iris[1:5, ],
31
+ columns = list(
32
+ Sepal.Length = colDef(name = "Sepal Length"),
33
+ Sepal.Width = colDef(name = "Sepal Width"),
34
+ Species = colDef(align = "center")
35
+ )
36
+ )
34
37
```
35
38
36
39
For convenience, you can also specify a default ` colDef() ` to use for all
@@ -55,12 +58,14 @@ reactable(
55
58
56
59
57
60
## Sorting
58
- Tables are sortable by default. You can sort on a column by clicking on its
59
- header, or sort on multiple columns by holding the shift key while sorting.
61
+ Tables are sortable by default. You can sort a column by clicking on its
62
+ header, or sort multiple columns by holding down the shift key while sorting.
63
+
64
+ You can also clear the sort of a column by holding the shift key while sorting.
60
65
61
66
### Default sort order
62
67
Tables are sorted in ascending order first by default. To customize the sort order,
63
- set ` defaultSortOrder ` on a table or column to either ` "asc" ` (ascending) or
68
+ set ` defaultSortOrder ` in a table or column to either ` "asc" ` (ascending) or
64
69
` "desc" ` (descending):
65
70
``` {r}
66
71
reactable(
@@ -73,7 +78,8 @@ reactable(
73
78
```
74
79
75
80
### Default sorted columns
76
- You can pre-sort columns by specifying a vector of column names in ` defaultSorted ` :
81
+ You can set the default sorted columns by providing a vector of column names
82
+ to ` defaultSorted ` :
77
83
``` {r}
78
84
reactable(iris[48:52, ], defaultSorted = c("Species", "Petal.Length"))
79
85
```
0 commit comments