I looked on the web how to quickly swap rows and columns but most of the solutions involved CSS. The EPUB format does not handle CSS very well and I preferred to convert the table in pure HTML. The only solution I found was in this SO post. I added support for the TH tag, wrapped the algorithm into a nice page and published it as a ready-to-use tool.
So if you need a quick way get the transpose of an table in pure HTML, try my HTML table swapper! Note that it does not support “colspan” and “rowspan” yet.
You can also have a look at the source code.