Dates are no longer always written as text. wb_add_gt() writes a Date,
date-time or ISO text column as spreadsheet dates when the printed text is
exactly what one of gt's date or time styles gives for the stored value, and
wb_add_html() does the same for whole days such as 31 January 2026.
Anything the format cannot reproduce stays text. The new convert_date
argument of both functions switches this off.
wb_add_html() gains dec_mark and big_mark. Without them the marks are
worked out from the whole table, and a table that uses two different ones is
left as text with a warning. A number is only converted when the text comes
back from the value, so 0.001 is no longer read as 1, 1.234 is not
guessed to be 1234, and ids such as 007 stay text.
fmt_url() and fmt_email() produce real hyperlinks, and an <a href> in
any HTML table does the same. A link that only points at a fragment of the
source page is skipped, since it means nothing in a workbook.
Where a cell holds several anchors, the first usable one is taken. A footnote marker pointing at a fragment of its own page no longer hides the real link beside it.
A <tr> with no cells is a spacer the page uses for layout, and no longer
lands as a blank row in the sheet.
A gt release that moves the internals this package reads now produces a
clear error naming the gt version and what is missing, rather than a wrong
sheet. That covers renamed columns inside the components, and a style
location or a tab_options() name gt no longer has is reported rather than
dropped. The message says plainly that it is a gtxlsx problem, so anyone
building on this package can forward it.
New features argument on wb_add_gt() and wb_add_html() decides what is
written besides the values: any of "font", "fill", "border",
"numfmt", "merge" and "link". FALSE writes values only, so a table
that goes wrong in one respect can still be written in every other.
New freeze argument keeps the heading and the stub in view while
scrolling. TRUE works the split out from the table, c(row, col) puts it
where you say.
Links that cannot be written are reported: a warning names how many were dropped because a cell already had one, and how many pointed only into the source page.
wb_add_html() accepts anything with an as.character() method that
returns HTML, so what rvest and xml2 hand back can be passed straight
in, whether that is a scraped page or a single <table> node. One table is
written per call, chosen with which.
The declared minimum for gt is now 0.8.0, which is where the suite still
passes. Tests that need a gt feature added later skip on the feature
rather than on a version number.
gt and markdown moved to Suggests, and xml2 is gone. wb_add_html()
now needs nothing but openxlsx2, so using it no longer pulls in gt's
dependency tree.
HTML is read by a parser in the package rather than by xml2. It handles
markup an XML parser rejects: <br>, unquoted attribute values, unclosed
<td>. Output for gt, lt, pivottabler, kable, htmlTable and
tinytable is unchanged.
CSS selectors are matched by walking their component chain, so div > td
and div td mean different things. Sibling combinators are skipped rather
than guessed at.
wb_add_gt() takes a gt_group() or gt_split() object and writes the
tables one after another, spaced by gap.
Works with gt 0.10.0 through 1.3.0.9000. On a multi-column stub, gt
records cells_stub() styles under a different location name; that is
handled now. Values printed without a leading zero, as drop_leading_zero
gives, stay numbers.
Minimum R version is 3.6.0. Nothing in the package needed 4.1.
Fixed border and fill handling. A border spanning several rows reached only the last of them, and striped tables left the plain rows unfilled, which showed as detached blocks rather than banding.
The CSS reader handles nested rules, var() custom properties and
positional pseudo-classes such as :not(:last-child), so lt tables keep
their borders.
New row_heights argument, off by default, sets row heights from gt's
padding and centres the text to match.
Group headings and summary labels are no longer forced bold; the weight
follows the gt option.
Spanners get the bottom border gt draws under them, and column labels get
their vertical lines under opt_table_lines("all").
wb_add_gt(), wb_add_html(), wb_add_lt() and wb_to_gt().