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

Fix for invisible top borders in rendered HTML tables #359

Merged
merged 2 commits into from Aug 16, 2019

Conversation

rich-iannone
Copy link
Member

This PR addresses the problem whereby gt tables, when rendered as HTML, have invisible top lines of cell borders (not visible unless 2px or larger).

The problem is isolated to the CSS rules of the gt_row class:

  .gt_row {
    padding: $row_padding; /* row.padding */
    margin: 10px;
    border-bottom-style: solid;
    border-bottom-width: thin;
    border-bottom-color: #D3D3D3;
    vertical-align: middle;
    overflow-x: hidden;
  }

Substituting all border-bottom-* rules for border-top-* avoids the line-drawing conflict between row lines and border lines. That is the only change in this PR and, through several visual tests, the changes made here fix the display issue.

Fixes: #358.

@schloerke
Copy link
Collaborator

exibble %>%
  select(num, date, datetime) %>%
  gt() %>%
  tab_style(
    style = cell_borders(),
    locations = cells_data(
      columns = vars(num),
      rows = num > 100 & num < 10000)
  )

fixed-top-border

@rich-iannone rich-iannone merged commit f67bf7f into master Aug 16, 2019
@rich-iannone rich-iannone deleted the top-cell-border-fix branch August 16, 2019 20:54
rich-iannone added a commit that referenced this pull request Aug 30, 2019
* master:
  Fix for invisible top borders in rendered HTML tables (#359)
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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Top lines in cell borders are overridden by row lines
2 participants