Writer Options

Each output format has a small set of options. Every binding takes them the same way, as a JSON object (a dict in Python, a named list in R); anything you leave out keeps its default. Unknown option names, wrong types and out-of-range values are errors, not silently ignored. gridwell formats --json (CLI), gridwell.formats() (Python) and gw_formats() (R) list every format with its options and defaults.

gridwell convert table.json --to latex --options '{"booktabs": false}'
gridwell convert table.json --to html --options-file html-options.json
table.render("latex", {"booktabs": False})
table.render_latex(booktabs=False)          # same, as keyword arguments
gw_render(tbl, "latex", list(booktabs = FALSE))
gw_render_latex(tbl, booktabs = FALSE)      # same, as named arguments
gw_render(tbl, "latex", '{"booktabs": false}')
gridwell_render_text_with_options(table, "latex", "{\"booktabs\": false}", &err);
let options = serde_json::json!({ "booktabs": false });
gridwell_render::render(&table, "latex", Some(&options))?;

Options by format

RTF, Pandoc, DOCX, XLSX and PPTX have no options; they accept only {} (or no options at all).

html

Option Type Default Meaning
inline_styles boolean false Put styles in style="…" attributes instead of a <style> block with classes
pretty_print boolean true Indent the markup, one element per line
class_prefix string "gw" Prefix for generated class names; letters, digits, _ and -, not starting with a digit or -
base_styles boolean true Include gridwell’s default look, modeled on gt’s (fonts, rules, padding). Its rules have zero specificity, so the table’s own styles and the host page’s CSS override them. false gives a bare fragment styled only by the table’s styles. Not applied with inline_styles
standalone boolean false Write a complete document (<!doctype html>, <meta charset="utf-8">, a <title> from the table’s title, lang from the locale) around the fragment, for a file opened on its own. Saving to .html doesn’t turn it on; pass it

latex

Option Type Default Meaning
booktabs boolean true Use booktabs rules (\toprule, \midrule, \bottomrule) instead of \hline
longtable boolean false Always use longtable (page-breaking) instead of tabular
longtable_threshold integer or null 30 Switch to longtable when there are more body rows than this; null never switches

typst

Option Type Default Meaning
repeat_header boolean true Wrap the column labels in table.header(…) so they repeat on every page

svg

Option Type Default Meaning
font_family string "Roboto, Helvetica, Arial, 'Liberation Sans', Arimo, sans-serif" CSS font list for all text; letters, digits, spaces, quotes and , - _ . only. Layout uses Roboto’s widths (and leaves room for Arial-compatible fallbacks), and every line is drawn with textLength, so viewers that substitute another font keep the layout; a list without Roboto or an Arial-compatible font may not fit as well in viewers that ignore textLength (librsvg)
font_size number 16 Base font size in px (greater than 0, at most 10000)
row_height number 0 Minimum row height in px (0–10000); 0: rows are as tall as their content
cell_padding_x number 5 Horizontal padding of body cells in px (0–10000); column labels and spanners use the default look’s own
cell_padding_y number 8 Vertical padding of body cells in px (0–10000)
default_col_width number 120 Heading and note lines wrap at the larger of the table’s width and eight times this, in px (about a page)
base_styles boolean true Draw gridwell’s default look, the same as HTML’s base stylesheet (gt’s rules, padding, sizes and text color); the table’s own styles still win. false: no rules and black text, same layout

ansi

Option Type Default Meaning
box_drawing boolean true Draw borders with Unicode box-drawing characters and footnote marks as superscripts (false: ASCII +, -, |, and marks as plain text)
true_color boolean true Color text with 24-bit escape codes
max_width integer 0 Shrink the widest columns until the grid fits this many terminal columns (cells are cut with …); 0 means no limit
background_colors boolean false Paint cell backgrounds (fills and striping) with 24-bit escapes; needs true_color. Off by default because fills meant for light pages show as bright bars on dark terminals
color boolean true Emit ANSI escape codes (bold, italic, colors); false gives plain text for files, logs and diffs. Saving to a file defaults it to false unless you set it

quarto

Option Type Default Meaning
table_id string or null null Cross-reference id; the wrapper Div gets id tbl-<table_id>
extra_attrs list of [key, value] pairs [] Extra attributes on the wrapper Div