Hey @Saad. Yeah one of the drawbacks to parsing these tables is that the parsed HTML doesn't show that stacked headers are in fact 'merged cells'. I'm not really sure how to get around that but the layout at least matches up to the table.
As for copying, the download handler doesn't have built in functionality to address copying to clipboard. I use the clipr with an observer to write to the clipboard. Keep in mind though that if you are hosting this on shiny server, you will have to install clipx https://forum.posit.co/t/copy-to-clipboard-and-downloadhandler-not-working-when-shiny-app-deployed-on-ubuntu-server/8127
I've edited my original answer with the updated code.