I'm using the Moovweb SDK and I'd like to transform a table and all it's elements into divs to facilitate mobile web dev/styling. What is the best way to do this?
<body>
<table>
<tbody>
<tr>
<td>
...
</td>
<tr>
</tbody>
</table>
</body>
There's a function I've seen used for this purpose in many projects called
table_dump
. I can't take credit for inventing it, but here it is in its entirety:It really does three things:
mw_was_
with its previous elementdata-mw-id
.With all three of these you can get rid of a table while preserving the diversity of its elements. This way it remains easily selectable in XPath and CSS, even after you've transformed it.