Skip to contents

The house table: hairline rules between rows, a heavier rule under the last row, bold column headers, and the first column left-aligned with the rest right-aligned. Use it for one table with tt(df, theme = theme_maison_tt), or for every table in a document with set_maison().

Usage

theme_maison_tt(x, dark = FALSE, ...)

Arguments

x

A table made by tinytable::tt().

dark

TRUE draws the rules in warm_white, for tables on dark slides.

...

Ignored. Present because tinytable calls a theme as theme(x, ...).

Value

The styled tinytable.

Details

The theme draws only what a stylesheet cannot know: where the rules go, the bold header row and the column alignment. Typeface and size are left to CSS. In HTML the table carries the classes tinytable and compact-design-tbl, which the Tweed and Twill stylesheets set in IBM Plex Mono; elsewhere the table inherits the document's font.

The rules are placed when the theme is applied, from the table's size at that moment. Rows added afterwards, for example with tinytable::group_tt(i = ), do not move the heavier closing rule.

To change the alignment, style the table afterwards, for example tinytable::style_tt(tab, j = 2, align = "l").

Examples

library(tinytable)
tt(head(mtcars[1:4]), theme = theme_maison_tt)
#> 
#> +---------+---------+----------+--------+
#> | **mpg** | **cyl** | **disp** | **hp** |
#> +=========+=========+==========+========+
#> | 21.0    | 6       | 160      | 110    |
#> +---------+---------+----------+--------+
#> | 21.0    | 6       | 160      | 110    |
#> +---------+---------+----------+--------+
#> | 22.8    | 4       | 108      | 93     |
#> +---------+---------+----------+--------+
#> | 21.4    | 6       | 258      | 110    |
#> +---------+---------+----------+--------+
#> | 18.7    | 8       | 360      | 175    |
#> +---------+---------+----------+--------+
#> | 18.1    | 6       | 225      | 105    |
#> +---------+---------+----------+--------+