Skip to contents

This function adds column and row borders to a gt table, creating a grid-like appearance. It can optionally include borders for column and row labels.

Usage

gt_border_grid(gt_object, color = "black", weight = 1, include_labels = FALSE)

Arguments

gt_object

A gt table object to modify.

color

A character string representing the color of the borders (default is "black").

weight

A numeric value specifying the thickness of the borders in pixels (default is 1).

include_labels

Logical. Whether to include borders around row and column labels (default is FALSE).

Value

A gt table object with the grid borders applied.

Details

The gt_border_grid function adds a grid to a gt table by applying column and row borders. It uses the gt_add_divider function from gtExtras to add column borders and applies custom CSS for row borders. The function also generates a random table ID if one is not provided.