-
Notifications
You must be signed in to change notification settings - Fork 213
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
Add function to specify column widths: cols_widths()
#293
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cols_widths()
cols_widths()
schloerke
approved these changes
Jul 26, 2019
rich-iannone
added a commit
that referenced
this pull request
Jul 26, 2019
* master: Add function to specify column widths: `cols_widths()` (#293)
rich-iannone
added a commit
to batpigandme/gt
that referenced
this pull request
Nov 11, 2019
* master: (59 commits) add fmt_markdown to _pkgdown.yml (rstudio#371) Use `tidy_grepl()` instead of `expect_match()` Use `tidy_grepl()` & `expect_true()` Add `dt_*()` methods for all major, internal data structures (rstudio#355) Update CLA text (rstudio#373) remove reliance on Github version of sass, which is now updated on CRAN (rstudio#366) Fix for invisible top borders in rendered HTML tables (rstudio#359) CSS modifications (rstudio#346) Incorporate alpha option to `cell_fill()` (rstudio#340) Enable option to set row group padding in `tab_options()` (rstudio#342) Modify `filter()` statement (rstudio#341) Allow use of integers in `pct()`/`px()` (rstudio#336) Fix for resolving row group cells (rstudio#335) Easier access to footnote mark options (rstudio#333) Export `as.tags.gt_tbl()` (rstudio#331) Several `rlang`-based fixes (rstudio#334) Add function to specify column widths: `cols_widths()` (rstudio#293) Add `rstudio/sass` to Remotes list (rstudio#326) Fix for `cell_borders()` (rstudio#323) Allow an empty table with zero rows to create an empty gt table (rstudio#283) ...
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR allows for manual adjustments to column widths via the new
cols_widths()
function. We choose which columns get specific widths (in pixels, usually by use of thepx()
helper function) and all other columns are assigned a default width value though the.others
argument.There are two ways make the width assignments, both occur in the
...
: (1) named arguments, where the names are those of the columns and the values are the dimensions (inpx
where, for instance,px(80)
would helpfully generate30px
), and, (2) pairedvars()
---px()
expressions, which:vars(col_b), px(120)
)starts_with()
,contains()
,everything()
, etc.) within eachvars()
expressionHere are two examples (using the two different expression styles) that make the same table:
Here is the table:
Fixes #111.