If you want to use kable with Quarto with proper formatting, you have to tell Quarto to ignore kable tables.
kable
kable(table.attr = 'data-quarto-disable-processing="true"')
See this closed Github issue.