\define makerow(i)
<tr order="$i$">
<td><<currentTiddler>></td>
</tr>
\end
\define XXX() 1
<table>
<$list filter="[tag[ActionWidgets]]">
<$macrocall $name="makerow" i=<<XXX>>/
>
</$list>
</table>
In some similar work in the mymenus plugin I simply used two list as follows;
Psuedo code
<Table>
Add th here
<$list filter
<tr>
<$list filter
<td><<detailsmacro>><td>
</$list>
</tr>
</$list>
</Table>
Leaving responcibility for table formatting out of a macro allows that macro to be used in otherways as a global macro.
And also if you want variables and fields to work inside html tags look at evans formula plugin as you can use it to programaticaly alter html tags
Eg
<tr order=(=yourcalc=) >