The cols_label_rotate() method sets the orientation of the column label text to make it flow vertically. The dir argument can be set to one of "sideways-lr", "sideways-rl", or "vertical-lr", and the columns argument can be used to specify which columns to apply the alignment to. If columns is not specified, the alignment is applied to all columns.
Parameters
columns:SelectExpr=None
The columns to target. Can either be a single column name or a series of column names provided in a list. If None, the alignment is applied to all columns.
The alignment to apply. Must be one of "left", "center", "right", or "none". If text is laid out vertically, this affects alignment along the vertical axis.
padding:int=8
The vertical padding to apply to the column labels.
Labels that are restricted by the height of the stub head will wrap horizontally.
( GT(exibble_sm, rowname_col="row", groupname_col="group") .cols_label({"fctr": "A longer description of the values in the column below"}) .cols_label_rotate(columns=["num", "fctr"], dir="sideways-lr") .tab_style( style=[style.text(weight="bold"), style.css(rule="height: 200px;")], locations=loc.column_labels(["fctr"]) ))
num
A longer description of the values in the column below
grp_a
row_1
0.1111
one
row_2
2.222
two
row_3
33.33
three
row_4
444.4
four
grp_b
row_5
5550.0
five
row_6
six
row_7
777000.0
seven
row_8
8880000.0
eight
Note
The dir parameter uses the following keywords to alter the direction of the column label text.
"sideways-lr"
For ltr scripts, content flows vertically from bottom to top. For rtl scripts, content flows vertically from top to bottom. Characters are set sideways toward the left. Overflow lines are appended to the right.
"sideways-rl"
For ltr scripts, content flows vertically from top to bottom. For rtl scripts, content flows vertically from bottom to top. Characters are set sideways toward the right. Overflow lines are appended to the left.
"vertical-lr"
Identical to "sideways-rl", but overflow lines are appended to the right.