[英]Kable column width in html rmarkdown
我想在 html rmarkdown 中顯示一個寬的kable
表,以顯示第一列有沒有任何換行符的長文本。 當我使用column_spec
設置第一列的寬度時,它似乎對生成的 html 表沒有任何影響。 這是我的代碼。 有沒有辦法讓第一列沒有任何換行符? 謝謝!
df <- data.frame(v1 = c('Long text without line breaks', 'Long text without line breaks', 'Long text without line breaks'),
v2 = c('text', 'text', 'text'),
v3 = c('text', 'text', 'text'),
v4 = c('text', 'text', 'text'),
v5 = c('text', 'text', 'text'),
v6 = c('text', 'text', 'text'),
v7 = c('text', 'text', 'text'),
v8 = c('text', 'text', 'text'),
v9 = c('text', 'text', 'text'),
v10 = c('text', 'text', 'text'),
v11 = c('text', 'text', 'text'),
v12 = c('text', 'text', 'text'),
v13 = c('text', 'text', 'text'),
v14 = c('text', 'text', 'text'),
v15 = c('text', 'text', 'text'),
v16 = c('text', 'text', 'text'),
v17 = c('text', 'text', 'text'),
v18 = c('text', 'text', 'text'),
v19 = c('text', 'text', 'text')
)
gctbl <- kable(df, col.names = colnames(df), escape = F) %>%
kable_styling(full_width = T) %>%
column_spec(1, width = '10in')
gctbl
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.