Solution to use images without CSS !
Hello Mike and ETI
Good news I've got it!
If you want to use images without css you can use this code.
Any number of column, options disabled or not, and the table containing the swatch is now close correctly.
Code:
{if $variants}
<table cellspacing="3" cellpadding="0" border="1" >
{assign var="image_counter" value=0}
{assign var="close_table" value=0}
{section name=swatch loop=$variants}
{foreach item=item key=key from=$variants[swatch].options}
{if $item.option_name ne '' }
{if $image_counter mod 5 eq 0}
<tr>
{assign var="image_counter" value=0}
{/if}
<td>{math equation="x+1" x=$image_counter assign="image_counter" }
[img]{$ImagesDir}/{$item.option_name|replace:[/img]</td>
{if $image_counter mod 5 eq 0 }
</tr>
{assign var="close_table" value=1}
{else}{assign var="close_table" value=0}
{/if} {/if}
{capture name=image_index}
{math equation="index+x+1" index=$image_counter x=5}
{/capture}
{/foreach}
{/section}
{if $close_table eq "0"}<td></td></tr>{/if}
</table>
{else}
{/if}
It might not be the cleanest code but it works.
Feel free to improve it.
Martin