With loc.column_header(), we can target the column header which contains all of the column labels and any spanner labels that are present. This is useful for applying custom styling with the tab_style() method. That method has a locations= argument and this class should be used there to perform the targeting.
A LocColumnHeader object, which is used for a locations= argument if specifying the column header of the table.
Examples
Let’s use a subset of the gtcars dataset in a new table. We create spanner labels through use of the tab_spanner() method; this gives us a column header with a mix of column labels and spanner labels. We will style the entire column header at once by using locations=loc.column_header() within tab_style().