Home > Software engineering >  gt() table - header color
gt() table - header color

Time:11-09

How do I add color to the header (i.e the column names) of my data frame using the gt() function in R

gt_Head <-
  gt_Head %>%
  tab_header(
  title = md("**Table of First 10 Observations**")
  )%>%
  tab_style(
    style = cell_text(weight = "bold"),
    locations = cells_body(
      rows = 0  
    )
  )

CodePudding user response:

You can use the column_labels.background.color option (see all options enter image description here

CodePudding user response:

Here is an example using exibble dataset from gt package. As you can find here in the documentation enter image description here

  •  Tags:  
  • rgt
  • Related