Convert HTML colspan and rowspan to “empty” cells
问题 For a certain output format ( not HTML-like), I need to convert HTML tables to 'square' tables, where each colspan and rowspan is not only indicated in the parent cell, but also followed by the correct number of empty cells. For example, the simple HTML table <table> <tr> <th>test</th> <th colspan="2">span 1/2</th> <th colspan="3">span 2/2</th> </tr> <tr> <td>col 1</td> <td>col 2</td> <td>col 3</td> <td>col 4</td> <td>col 5</td> <td>col 6</td> </tr> </table> should be translated to <table>