Using RMarkdown section number


I am using htmlTable with the table number in the caption via

table_counter_str = "Table %s: ")

in the setup chunk. However, the table number (table_counter) resets with each section. To get around this, I would like to use a compound table number that looks like <sect_counter>.<table_counter>.

How can I access section and subsection numbers?

Thanks in advance!