-
The new
opt_table_font()
function makes it possible to define a custom font for the entire gt table. The standard fallback fonts are still set by default but the font defined here will take precedence. You could still have different fonts in select locations in the table, and for that you would need to usetab_style()
in conjunction with thecell_text()
helper function. The newgoogle_font()
helper function provides an option for supplying a font available at the Google Fonts service (this is in addition to using system fonts in thefont
argument). Using theinfo_google_fonts()
function will provide a table with a set of helpful font recommendations from the Google Fonts catalog. The newdefault_fonts()
functions provides a helpful vector of system fallback fonts which works well when defining a vector of fonts. (#591) -
The new
opt_css()
function makes allows for the addition of custom CSS to a gt table. This CSS will be added after the compiled CSS that gt generates automatically when thegt_tbl
object is transformed to an HTML output table. You can supplycss
as a vector of lines or as a single string. Thecss()
function has been re-exported from htmltools to make it easier to build CSS style declarations. (Also #591) -
Setting the widths of table columns is now easier and more dependable with
cols_width()
. Widths can be expressed in units of pixels (easily set by use of thepx()
helper function), as percentages (where thepct()
helper function is useful), or a mixture of the two. The function takes into consideration whether an overall table width has been provided withtab_options(table.width = ...)
. Providing pixel widths for all columns serves to override any table width defined (yielding columns with the exact widths specified). (#561) -
There are new options for numeric formatting: (1) using significant figures (with
n_sigfig
infmt_number
), and (2) the ability to retain/drop trailing decimal marks (withdrop_trailing_dec_mark
infmt_number()
,fmt_percent()
, andfmt_currency()
). Thank you @drolejoel for the suggestion in #535! (#546). -
The new
scale_values
argument forfmt_percent()
makes it easy to use values that are already scaled (and just require the percent mark). Thank you @djohn215 for the suggestion in #559. (#565) -
Font weights expressed as numeric values (e.g.,
400
,600
, etc.) incell_text()
'sweight
argument now works properly. (#591)
-
The
data_color()
function has been rewritten to improve performance (#543). (#576) -
Restore the ability to have row striping in stub cells (with
tab_option()
'srow.striping.include_stub = TRUE
). Thanks @gergness for creating PR #537, which prompted this final fix. (#564)
-
summary_rows()
andgrand_summary_rows()
no longer incorrectly calculate summary values in cases where rows aren't already sorted by group (#556). -
Ensure compatibility with tibble 3.0.0. (#557)
-
Adapt tests to changes in dependent packages. (#575)
- New package with 80 exported functions for building display tables