?r ```rs
#set par(justify: true)
#let table-footnote-counter-marker = counter("table-footnote-counter-marker")
#let table-footnote-counter-content = counter("table-footnote-counter-content")
#let table-footnote-counter-table = counter("table-footnote-counter-table")
#show table: it => {
table-footnote-counter-marker.update(0)
table-footnote-counter-content.update(0)
table-footnote-counter-table.step()
it
}
#let table-numbering-pattern = "a"
#let table-footnote-label = "table-footnote"
#let table-footnote-marker() = {
table-footnote-counter-marker.step()
context {
let table-counter = table-footnote-counter-table.get().first()
let counter = table-footnote-counter-marker.get().first()
link(label(table-footnote-label + "-" + str(table-counter) + "-" + str(counter)), super(numbering(table-numbering-pattern, counter)))
}
}
#let table-footnote-content(content) = {
table-footnote-counter-content.step()
context {
let table-counter = table-footnote-counter-table.get().first()
let counter = table-footnote-counter-content.get().first()
let number = super(numbering(table-numbering-pattern, counter))
align(left)[#number #content #label(table-footnote-label + "-" + str(table-counter) + "-" + str(counter))]
}
}
#set figure.caption(position: top)
#figure(
[#table(
columns: 2,
[a#table-footnote-marker()], [b],
[c#table-footnote-marker()], [d]
)
#table-footnote-content(lorem(30))
#table-footnote-content(lorem(10))
],
caption: [A table with letters]
)