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

Computational table always with border #12057

Open
fkohrt opened this issue Feb 11, 2025 · 2 comments
Open

Computational table always with border #12057

fkohrt opened this issue Feb 11, 2025 · 2 comments
Assignees
Labels
bug Something isn't working tables Issues with Tables including the gt integration themes Related to HTML theming or any other style related issue (like highlight-style)

Comments

@fkohrt
Copy link

fkohrt commented Feb 11, 2025

Bug description

By default, a computational table is small, striped, and has a border. By adding the class plain it only has a border (see #2997). But it is not possible to remove the border by adding the class borderless:

Steps to reproduce

---
title: "Test"
format:
  html:
    df-print: kable
---

```{r}
#| classes: ".plain .borderless"

mtcars |>
  head(n = 10)
```

Image

(Also, it seems inconsistent that classes requires dots, whereas class-output doesn't.)

Expected behavior

No horizontal border between rows.

Actual behavior

There is a horizontal border between rows.

Your environment

  • RStudio 2024.04.2+764.pro1 "Chocolate Cosmos" Release (653611509504ac6640465e42d455d05dce98e1c4, 2024-06-05) for Ubuntu Focal
    Mozilla/5.0 (X11; Linux x86_64; rv:134.0) Gecko/20100101 Firefox/134.0, Quarto 1.6.39 (/opt/quarto/bin/quarto)
  • Ubuntu 20.04.6 LTS

Quarto check output

Quarto 1.6.39
[✓] Checking environment information...
      Quarto cache location: /home/r155953/.cache/quarto
[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.4.0: OK
      Dart Sass version 1.70.0: OK
      Deno version 1.46.3: OK
      Typst version 0.11.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 1.6.39
      Path: /opt/quarto/bin

[✓] Checking tools....................OK
      TinyTeX: (not installed)
      Chromium: (not installed)

[✓] Checking LaTeX....................OK
      Using: Installation From Path
      Path: /usr/bin
      Version: 2019

[✓] Checking basic markdown render....OK

[✓] Checking Python 3 installation....OK
      Version: 3.8.17
      Path: /tmp/Rtmpg1QFlO/rstudio/terminal/python3
      Jupyter: (None)

      Jupyter is not available in this Python installation.
      Install with python3 -m pip install jupyter

[✓] Checking R installation...........OK
      Version: 4.4.2
      Path: /opt/R/4.4.2/lib/R
      LibPaths:
        - /cloud/lib/x86_64-pc-linux-gnu-library/4.4
        - /opt/R/4.4.2/lib/R/library
      knitr: 1.49
      rmarkdown: 2.29

[✓] Checking Knitr engine render......OK
@fkohrt fkohrt added the bug Something isn't working label Feb 11, 2025
@fkohrt fkohrt changed the title Computational table always striped Computational table always with border Feb 11, 2025
@fkohrt
Copy link
Author

fkohrt commented Feb 11, 2025

This is more similar to the actual table I would like to have borderless:

---
title: "Test"
format: html
---

```{r}
#| echo: false
#| classes: .plain .borderless

datawizard::data_codebook(mtcars) |>
  datawizard::data_select(exclude = c("ID", ".row_id")) |>
  datawizard::data_filter(N != "") |>
  datawizard::print_md()
```
sessionInfo()
R version 4.4.2 (2024-10-31)
Platform: x86_64-pc-linux-gnu
Running under: Ubuntu 20.04.6 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/liblapack.so.3;  LAPACK version 3.9.0

locale:
 [1] LC_CTYPE=C.UTF-8       LC_NUMERIC=C          
 [3] LC_TIME=C.UTF-8        LC_COLLATE=C.UTF-8    
 [5] LC_MONETARY=C.UTF-8    LC_MESSAGES=C.UTF-8   
 [7] LC_PAPER=C.UTF-8       LC_NAME=C             
 [9] LC_ADDRESS=C           LC_TELEPHONE=C        
[11] LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C   

time zone: UTC
tzcode source: system (glibc)

attached base packages:
[1] stats     graphics  grDevices utils     datasets 
[6] methods   base     

loaded via a namespace (and not attached):
[1] compiler_4.4.2   cli_3.6.3        tools_4.4.2     
[4] datawizard_1.0.0 knitr_1.49       insight_1.0.2   
[7] xfun_0.50        evaluate_1.0.3  

@cderv
Copy link
Collaborator

cderv commented Feb 11, 2025

(Also, it seems inconsistent that classes requires dots, whereas class-output doesn't.)

classes does not require dots when a single class is used

```{r}
#| classes: plain

mtcars |>
  head(n = 10)
```

It seems we should handle multiple classes here.

class-output is a knitr only option, and handled directly by knitr. classes should probably work the same. I'll look to fix this.

Regarding the .borderless not applying here, the Markdown syntax for it should be

|                  |  mpg| cyl|  disp|  hp| drat|    wt|  qsec| vs| am| gear| carb|
|:-----------------|----:|---:|-----:|---:|----:|-----:|-----:|--:|--:|----:|----:|
|Mazda RX4         | 21.0|   6| 160.0| 110| 3.90| 2.620| 16.46|  0|  1|    4|    4|
|Mazda RX4 Wag     | 21.0|   6| 160.0| 110| 3.90| 2.875| 17.02|  0|  1|    4|    4|
|Datsun 710        | 22.8|   4| 108.0|  93| 3.85| 2.320| 18.61|  1|  1|    4|    1|
|Hornet 4 Drive    | 21.4|   6| 258.0| 110| 3.08| 3.215| 19.44|  1|  0|    3|    1|
|Hornet Sportabout | 18.7|   8| 360.0| 175| 3.15| 3.440| 17.02|  0|  0|    3|    2|
|Valiant           | 18.1|   6| 225.0| 105| 2.76| 3.460| 20.22|  1|  0|    3|    1|
|Duster 360        | 14.3|   8| 360.0| 245| 3.21| 3.570| 15.84|  0|  0|    3|    4|
|Merc 240D         | 24.4|   4| 146.7|  62| 3.69| 3.190| 20.00|  1|  0|    4|    2|
|Merc 230          | 22.8|   4| 140.8|  95| 3.92| 3.150| 22.90|  1|  0|    4|    2|
|Merc 280          | 19.2|   6| 167.6| 123| 3.92| 3.440| 18.30|  1|  0|    4|    4|

: Test {.plain .borderless}

So for computational table, I am not sure if we have support for all classes through the classes options. Possibly we need to enhance style support for computational table.

I'll check this. Thanks for the report.

@cderv cderv self-assigned this Feb 11, 2025
@cderv cderv added tables Issues with Tables including the gt integration themes Related to HTML theming or any other style related issue (like highlight-style) labels Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working tables Issues with Tables including the gt integration themes Related to HTML theming or any other style related issue (like highlight-style)
Projects
None yet
Development

No branches or pull requests

2 participants