haozhu233 / kableExtra

Construct Complex Table with knitr::kable() + pipe.
https://haozhu233.github.io/kableExtra/
Other
691 stars 147 forks source link

responsive bootstrap styling adds border #623

Closed rcragun closed 11 months ago

rcragun commented 3 years ago

Describe the bug

Passsing the responsive bootstrap styling option to kable_styling() adds a border around the table.

To Reproduce

Code for example table

library(tidyverse)
library(knitr)
library(kableExtra)

DatTemp = tribble(
  ~X, ~Y,
   0,  1,
   1,  2)

DatTemp %>% 
  kable() %>% 
  kable_styling(bootstrap_options = c('responsive'), full_width=F)

Note: I use full_width=F just to make the border easier to see.

Rendered table

This is how the code above renders the table in the RStudio viewer (and when knitting to HTML): kableExtraResponsiveBorder

Expected behavior

responsive will only apply styling associated with the table-responsive Bootstrap class, which does not include a border around the table (e.g., https://www.w3schools.com/bootstrap/tryit.asp?filename=trybs_ref_table-responsive&stacked=h).

My session info

R version 4.0.3 (2020-10-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19042)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252    LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                           LC_TIME=English_United States.1252    

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

other attached packages:
 [1] kableExtra_1.3.4 knitr_1.33       forcats_0.5.1    stringr_1.4.0    dplyr_1.0.6      purrr_0.3.4      readr_1.4.0     
 [8] tidyr_1.1.3      tibble_3.1.1     ggplot2_3.3.3    tidyverse_1.3.1 

loaded via a namespace (and not attached):
 [1] bslib_0.2.4       tidyselect_1.1.1  xfun_0.22         haven_2.4.1       colorspace_2.0-1  vctrs_0.3.8       generics_0.1.0   
 [8] viridisLite_0.4.0 htmltools_0.5.1.1 utf8_1.2.1        rlang_0.4.10      jquerylib_0.1.4   pillar_1.6.0      glue_1.4.2       
[15] withr_2.4.2       DBI_1.1.1         dbplyr_2.1.1      modelr_0.1.8      readxl_1.3.1      lifecycle_1.0.0   munsell_0.5.0    
[22] gtable_0.3.0      cellranger_1.1.0  rvest_1.0.0       evaluate_0.14     fansi_0.4.2       highr_0.9         broom_0.7.6      
[29] Rcpp_1.0.6        scales_1.1.1      backports_1.2.1   webshot_0.5.2     jsonlite_1.7.2    fs_1.5.0          systemfonts_1.0.1
[36] hms_1.0.0         digest_0.6.27     stringi_1.5.3     grid_4.0.3        cli_2.5.0         tools_4.0.3       sass_0.3.1       
[43] magrittr_2.0.1    crayon_1.4.1      pkgconfig_2.0.3   ellipsis_0.3.1    xml2_1.3.2        reprex_2.0.0      lubridate_1.7.10 
[50] assertthat_0.2.1  rmarkdown_2.7     svglite_2.0.0     httr_1.4.2        rstudioapi_0.13   R6_2.5.0          compiler_4.0.3   
vincentarelbundock commented 11 months ago

I cannot reproduce this problem in either the viewer pane, a Quarto document or a Rmarkdown document. Please try with the latest development version of kableExtra from Github and let us know if you still encounter the problem.