Skip to content

Formatting of tables #21

@aridus

Description

@aridus

Following this suggestion ##15 I can use this code

library(knitr)
library(kableExtra)
options(kableExtra.html.bsTable = T)
options(knitr.kable.NA = '')
data_sources <- read_csv("tables/data_sources.csv")
kable(data_sources) %>%
  kable_styling() %>% 
  row_spec(0, bold = F) %>% 
  row_spec(1, background = "#eff9fe") %>% 
  row_spec(6, background = "#eff9fe") %>% 
  row_spec(10, background = "#eff9fe") %>% 
  row_spec(15, background = "#eff9fe")

to style a table (although row_spec(0, bold = F) does not prevent bolding of the header row).

But the table is placed across the whole page (i.e. tab.margin = FALSE has no effect) and a citation of the usual form (Table @ref(tab:data-sources)) does not link to the table.

Is there a solution to this problem?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions