I'd literally spin up a PHP container with TCPDF and do caveman math on cell sizes. Making something fancy with it is a lot of work, but it is a steady, incremental work. Doing stuff with HTML+CSS conversion is just frustrating and you'll likely get 90% there then spend most of the time kicking and bashing CSS until it behaves nicely in that obscure case. In TCPDF I was able to make a temporary page, write to it, check the positions, discard that page and arrange the actual content based on that. You can't do that with CSS, good luck guessing how much horizontal space the text takes