Documentation Index
Fetch the complete documentation index at: https://mintlify.com/davidgohel/flextable/llms.txt
Use this file to discover all available pages before exploring further.
set_table_properties() controls the overall layout algorithm, table width, document alignment, and output-specific behavior for HTML, Word, and PDF.
Function signature
Parameters
A
flextable object.Layout algorithm:
"fixed"— column widths set bywidth()are used as-is. Thewidthparameter has no effect in this mode."autofit"— column widths are ignored; the table uses thewidthparameter as a proportion of the available space. Supported in HTML and Word; ignored in PowerPoint.
Minimum width for the table as a proportion of the page or container width (0 to 1). Behavior varies by output format:
- HTML — minimum width of the space the table occupies.
- Word — preferred size; Word may not strictly respect it.
- PowerPoint / PDF — has no effect.
0 means the table uses only the width necessary to display all content.Table alignment within the document. One of
"left", "center", or "right". Applies to Word, HTML, and PDF output.HTML-specific options. Supported keys:
extra_css(string) — additional CSS to inject into the table’s HTML.scroll(list or NULL) — add a scroll box around the table. Options within the list:- (empty list) — horizontal scroll only, width matches the container.
height(number or string) — enables vertical scroll at the given height. Numeric values are pixels; strings must be valid CSS measures (e.g.,"500px").freeze_first_column(logical) — whenTRUE, the first column is sticky and does not scroll horizontally.add_css(string) — extra CSS for the scroll container.
extra_class(string) — additional CSS class names to add to the<table>tag.
Word-specific options. Supported keys:
split(logical) — whenTRUE, enables the Word option “Allow row to break across pages”.keep_with_next(logical) — whenTRUE, enables “Keep rows together”, preventing page breaks inside the table. Useful for small tables.repeat_headers(logical) — whenTRUE, header rows repeat at the top of each page.
PDF/LaTeX-specific options. Supported keys:
tabcolsep(number) — horizontal space between cell content and the left/right cell border.arraystretch(number) — row height multiplier relative to the default. Default is1.5.float(string) — floating placement for the table. One of:"none"(default) — table appears immediately after the preceding paragraph."float"— table floats to the best available position."wrap-r"— wrap text around the table on the right side."wrap-l"— wrap text around the table on the left side."wrap-i"— wrap on the inside edge (near the binding)."wrap-o"— wrap on the outside edge (away from the binding).
fonts_ignore(logical) — whenTRUE, allows thepdflatexengine to be used; fonts are ignored becausepdflatexdoes not support custom fonts (unlikexelatexorlualatex).caption_repeat(logical) — whether the caption repeats across pages. Default isTRUE.footer_repeat(logical) — whether the footer repeats across pages. Default isTRUE.default_line_color(string) — default line color, restored globally after the table is produced.
Alternative text used as the table title in Word (accessibility metadata).
Alternative text used as the table description in Word (accessibility metadata).
Return value
The modifiedflextable object.
Examples
Set autofit layout at 50% of page width:PowerPoint output ignores the
"autofit" layout setting.See also
autofit()— compute and apply optimised column widthswidth()— set explicit column widthsflextable()— create a flextable