I need to create a table in page product.
Now my code work well but, in some products, there is white space in table.
My code:
<?php if($_additional = $this->getAdditionalData()): ?>
<h2><?php echo $this->__('Additional Information') ?></h2>
<table class="data-table" id="product-attribute-specs-table">
<col width="25%" />
<col />
<tbody>
<?php $_totale=count($_additional); $_contatore=0; ?>
<?php foreach ($_additional as $_data): ?>
<?php if (!strpos(($_data['code']),"filtro")) { ?>
<?php if ($_data['value']!="No" ): ?>
<?php if ($_contatore%2==0): ?>
<tr>
<?php endif; ?>
<th class="label"><?php echo $this->htmlEscape($this->__($_data['label'])) ?></th>
<!--<td class="data"><?php echo $_helper->productAttribute($_product, $_data['value'], $_data['code']) ?>-->
<td class="data">
<?php #echo ">>".$_data['code']."<<"; ?>
<?php echo $_data['value']; ?>
</td>
<?php if ($_contatore%2==1): ?>
</tr>
<?php endif; ?>
<?php endif; ?>
<?php $_contatore++; ?>
<?php } ?>
<?php endforeach; ?>
</tbody>
</table>
<script type="text/javascript">decorateTable('product-attribute-specs-table')</script>
If use the "modulo" operation.
can you help me?
if ($_contatore%2==0):
needs to be the same after you close your td. also why are you using <th> tag next to <td> tag?