I am trying to create hyperlinks inside a table and also adjust columns to wrap text and generate pdf.
Ex table:
variable<-"testing a long column to wrap testing a long column to wrap "
col1<-"\href{https://www.google.co.uk/}{click here}"
col2<-"[click here](https://www.google.co.uk/)"
col3<-"[click here](https://www.google.co.uk/)"
col4<-"[click here](https://www.google.co.uk/)"
col5<-"[click here](https://www.google.co.uk/)"
test<-data.frame(variable,col1,col2,col3,col4,col5)
When I tried the following it gives the hyperlinks correctly but does not adjust column width
library(kableExtra)
knitr::kable(test,row.names=FALSE) %>%
column_spec(1, width = "5cm")
But when I tried with including format ='latex'
then hyperlinks does not work but column width and wrap texts
library(kableExtra)
knitr::kable(test,format ='latex' ,row.names=FALSE) %>%
column_spec(1, width = "5cm")
Please help me to add hyperlink and also to adjust column width in Rmarkdown.