Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable table striping options #236

Merged
merged 10 commits into from
May 1, 2019
Merged

Enable table striping options #236

merged 10 commits into from
May 1, 2019

Conversation

rich-iannone
Copy link
Member

There are settings in tab_options() that allow us to enable/disable row striping both in the table body and also in the stub. Unfortunately, these options didn't do anything. With this PR, they are now operational.

Here are a few examples. First, here's the default case:

library(gt)
library(tidyverse)

exibble %>%
  select(num, currency, row, group) %>%
  gt(groupname_col = "group", rowname_col = "row")

row_striping_default

Here is row striping both in the table body and also in the table stub:

exibble %>%
  select(num, currency, row, group) %>%
  gt(groupname_col = "group", rowname_col = "row") %>%
  tab_options(
    row.striping.include_table_body = TRUE,
    row.striping.include_stub = TRUE
  )

row_striping_all

One last example, where the stub has stripes and the table body does not:

exibble %>%
  select(num, currency, row, group) %>%
  gt(groupname_col = "group", rowname_col = "row") %>%
  tab_options(
    row.striping.include_table_body = FALSE,
    row.striping.include_stub = TRUE
  )

row_striping_stub_only

This fixes #199.

@rich-iannone rich-iannone marked this pull request as ready for review March 30, 2019 04:22
@rich-iannone rich-iannone requested a review from jcheng5 April 1, 2019 20:40
* master:
  Include option to hide all column labels (#237)
* master:
  Use webshot to generate images of HTML tables (#257)
  Rewritten vignette for adding summary rows (#273)
  Move roxygen documentation to Markdown (#253)
  Store empty-string value in `sep` vector (#274)
  Bugfixes and improvements to `summary_rows()` (#175)
  Modify _travis.yml (#263)
  Make several refactoring improvements to some `format_*()` functions (#244)
@rich-iannone rich-iannone requested a review from schloerke May 1, 2019 20:00
@rich-iannone rich-iannone merged commit aa5244b into master May 1, 2019
@rich-iannone rich-iannone deleted the striping-options branch May 1, 2019 20:04
rich-iannone added a commit that referenced this pull request May 1, 2019
* master:
  Enable table striping options (#236)
rich-iannone added a commit that referenced this pull request May 2, 2019
* master:
  Enable table striping options (#236)
  Path expand all file inputs (#278)
rich-iannone added a commit that referenced this pull request May 7, 2019
* master:
  Adding the `currency()` helper function for specifying custom currencies (#281)
  Enable table striping options (#236)
  Path expand all file inputs (#278)
rich-iannone added a commit that referenced this pull request May 7, 2019
* master:
  Adding the `currency()` helper function for specifying custom currencies (#281)
  Enable table striping options (#236)
  Path expand all file inputs (#278)
rich-iannone added a commit that referenced this pull request May 7, 2019
* master:
  Adding the `currency()` helper function for specifying custom currencies (#281)
  Enable table striping options (#236)
  Path expand all file inputs (#278)
rich-iannone added a commit that referenced this pull request May 7, 2019
* master:
  Adding the `currency()` helper function for specifying custom currencies (#281)
  Enable table striping options (#236)
  Path expand all file inputs (#278)
rich-iannone added a commit that referenced this pull request May 8, 2019
* master:
  Adding the `currency()` helper function for specifying custom currencies (#281)
  Enable table striping options (#236)
  Path expand all file inputs (#278)
  Use webshot to generate images of HTML tables (#257)
  Rewritten vignette for adding summary rows (#273)
  Move roxygen documentation to Markdown (#253)
  Store empty-string value in `sep` vector (#274)
  Bugfixes and improvements to `summary_rows()` (#175)
  Modify _travis.yml (#263)
  Make several refactoring improvements to some `format_*()` functions (#244)
  Include option to hide all column labels (#237)
  Refactoring of formatter functions (#232)
  Improvement to the handling of a `pattern` in most `fmt*()` functions (#95)
  pkgdown cleanup (#226)
  Make argument names in `tab_options()` more consistent with terminology (#221)
  dplyr::data_frame deprecated (#195)
  Remove a unicode character from roxygen documentation (#220)
rich-iannone added a commit that referenced this pull request May 9, 2019
* master: (44 commits)
  Have the table ID be settable, random, or absent in `gt()` (#286)
  Adding the `currency()` helper function for specifying custom currencies (#281)
  Enable table striping options (#236)
  Path expand all file inputs (#278)
  Use webshot to generate images of HTML tables (#257)
  Rewritten vignette for adding summary rows (#273)
  Move roxygen documentation to Markdown (#253)
  Store empty-string value in `sep` vector (#274)
  Bugfixes and improvements to `summary_rows()` (#175)
  Modify _travis.yml (#263)
  Make several refactoring improvements to some `format_*()` functions (#244)
  Include option to hide all column labels (#237)
  Refactoring of formatter functions (#232)
  Improvement to the handling of a `pattern` in most `fmt*()` functions (#95)
  pkgdown cleanup (#226)
  Make argument names in `tab_options()` more consistent with terminology (#221)
  dplyr::data_frame deprecated (#195)
  Remove a unicode character from roxygen documentation (#220)
  Try again, this time with `travis encrypt --com`
  Trying again with github token (#223)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FR] An easier way of disabling the row striping
2 participants