This page covers two utilities that complement the border functions in flextable.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.
fix_border_issues()
fix_border_issues() resolves rendering inconsistencies that can occur when borders of adjacent cells conflict. flextable stores borders per-cell, and when both adjacent cells specify a shared edge, different output formats resolve the conflict differently. This function normalises the border data so that rendering is consistent across Word, PowerPoint, HTML, and PDF.
Call this function after you have finished applying all border settings and before rendering.
A
flextable object.Which part to process:
"body", "header", "footer", or "all".Return value
The modifiedflextable object with normalised border data.
Example
before()
before() is a helper function used as a row selector inside the i argument of hline(). It returns a logical vector that is TRUE for every row that immediately precedes one of the specified entries values. This makes it easy to draw a separator line above summary rows such as "Total".
The column values to test. Typically a column from the table’s data frame.
One or more values to search for. The function returns
TRUE for the row immediately before each first occurrence of any of these values.Return value
A logical vector of the same length asx.
Example
Insert a thick line above the “Total” row:See also
hline()— draw horizontal lines at specific rowsborder_outer()— set the outer table borderborder_inner_h()— set inner horizontal borders