Option to wrap an outline around the entire table.
The opt_table_outline() method puts an outline of consistent style=, width=, and color= around the entire table. It’ll write over any existing outside lines so long as the width= value is larger that of the existing lines. The default value of style= ("solid") will draw a solid outline, whereas using "none" will remove any present outline.
Parameters
style:str='solid'
The style of the table outline. The default value is "solid". The valid values are "solid", "dashed", "dotted", and "none".
width:str='3px'
The width of the table outline. The default value is "3px". The value must be in pixels and it must be an integer value.
color:str='#D3D3D3'
The color of the table outline, where the default is "#D3D3D3". The value must either a hexadecimal color code or a color name.
The GT object is returned. This is the same object that the method is called on so that we can facilitate method chaining.
Examples
Using select columns from the exibble dataset, let’s create a table with a number of components added. Following that, we’ll put an outline around the entire table using the opt_table_outline() method.
from great_tables import GT, exibble, md( GT( exibble[["num", "char", "currency", "row", "group"]], rowname_col="row", groupname_col="group" ) .tab_header( title=md("Data listing from **exibble**"), subtitle=md("`exibble` is a **Great Tables** dataset.") ) .fmt_number(columns="num") .fmt_currency(columns="currency") .tab_source_note(source_note="This is only a subset of the dataset.") .opt_table_outline())