i've got a little problem on my hands here, perhaps one of you have a solution..
basically the scenario is as follows;
i have a number of csv files (variable row and column count), all of which have to be parsed and slapped into a standard html table for presentation. so far so good, no problems here.
the problem, however, is that not all fields have values, resulting in a massive bunch of empty table cells, which i'd like to get rid of - as well as set colspans for the remaining cells -with- values to fill out the space and fix the flow a bit..
long story short, i have this:
Code: Select all
<tr>
<td>something</td><td></td><td></td><td></td>
</tr>
<tr>
<td></td><td>something</td><td></td><td>meep</td>
</tr>
<tr>
<td></td><td></td><td></td><td>blah</td>
</tr>Code: Select all
<tr>
<td colspan='4'>something</td>
</tr>
<tr>
<td></td><td colspan='2'>something</td><td>meep</td>
</tr>
<tr>
<td colspan='3'></td><td>blah></td>
</tr>so, anyone have an idea on how to do this? if i can simply solve this with a nice little regex that'd be preferable, but if someone has a radically different solution that'd work i'm all ears.