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

Have the table ID be settable, random, or absent in gt() #286

Merged
merged 21 commits into from
May 8, 2019

Conversation

rich-iannone
Copy link
Member

This change allows us to more explicitly set the table ID though the id option in gt(). By default this is set to use the new helper function id_random(), which is equivalent to the current behavior of having a 10-letter random string being generated with each gt() call.

We can use a custom string here, or, use NULL to entirely disable ID generation. Here's a basic usage example where we set a custom id value:

library(gt)

exibble %>% gt(id = "name")

The following screen capture shows that the id for the enclosing <div> is now set to "name":

gt_id_set

Here's another showing that the id attr can be omitted entirely:

library(gt)

exibble %>% gt(id = NULL)

gt_id_null

Fixes: #141.

* 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 rich-iannone requested a review from schloerke May 8, 2019 16:41
NAMESPACE Outdated Show resolved Hide resolved
@rich-iannone rich-iannone requested a review from schloerke May 8, 2019 18:59
@rich-iannone rich-iannone merged commit 1a17e8a into master May 8, 2019
@rich-iannone rich-iannone deleted the random-id-generation branch May 8, 2019 20:01
rich-iannone added a commit that referenced this pull request May 8, 2019
* master:
  Have the table ID be settable, random, or absent in `gt()` (#286)
rich-iannone added a commit that referenced this pull request May 9, 2019
* master:
  Have the table ID be settable, random, or absent in `gt()` (#286)
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)
  ...
rich-iannone added a commit that referenced this pull request Jun 30, 2019
* master:
  Add options related to the table <div> (#285)
  Have the table ID be settable, random, or absent in `gt()` (#286)
rich-iannone added a commit that referenced this pull request Jul 12, 2019
* master:
  Add the `cells_stubhead_label()` location helper (#276)
  Refactoring of the `tab_options()` function (#288)
  Add the `path` argument to `gtsave()` (#290)
  Refactoring of heading component (#239)
  Use `sass` package from CRAN (not GitHub) (#313)
  Add options related to the table <div> (#285)
  Have the table ID be settable, random, or absent in `gt()` (#286)
rich-iannone added a commit that referenced this pull request Jul 15, 2019
* master:
  Add the `cells_stubhead_label()` location helper (#276)
  Refactoring of the `tab_options()` function (#288)
  Add the `path` argument to `gtsave()` (#290)
  Refactoring of heading component (#239)
  Use `sass` package from CRAN (not GitHub) (#313)
  Add options related to the table <div> (#285)
  Have the table ID be settable, random, or absent in `gt()` (#286)
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.

Disable random div id generation?
2 participants