You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在gt表格不同列设置不同脚注标记(将wt列改为*)

修改gt表格的脚注标记

要实现保留disp列脚注标记1、将wt列脚注标记改为星号(*)的需求,只需在tab_footnote函数中通过mark参数指定自定义标记即可:

library(gt)

# 创建示例gt表格并自定义脚注标记
my_table <- gt(head(mtcars, 10))

my_table %>% 
  tab_footnote(
    footnote = "Sequenced twice.",
    locations = cells_body(columns = disp, rows = c(1,2))
  ) %>% 
  tab_footnote(
    footnote = "Change mark",
    locations = cells_body(columns = wt, rows = c(4,5)),
    mark = "*"  # 为该脚注指定星号标记
  )

说明:

  • 第一个脚注未指定mark参数,会沿用gt默认的数字序列标记,第一个脚注自然为1,满足保留需求
  • 第二个脚注通过mark = "*"直接覆盖默认数字,将标记替换为星号
  • 表格底部的脚注区域会自动对应显示星号与对应的注释内容

内容的提问来源于stack exchange,提问作者LDT

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.07 11:46:03