|
Posted by Peter Fox on 10/09/06 09:44
Following on from elia's message. . .
>Hello,
>
>I would like to show a line in a tabel in html if there is quantity of
>article choosed.
>
>My code is:
broken.
* use _double_ quotes to get $-variables rendered.
* to escape double quotes use \"
* nowrap html syntax!
* print() is same as echo()
* Euro combined with montant
* I've modified your table format to remove redundant and space
consuming bits.
// print column headings before loop
print("<tr><th>Article</th><th>Montant</th></tr>\n");
// inside the loop
if ($quantite1 > 0) { // ignore if no quantity
// tidy up montant for pretty printing
if(!$montant==0){ // assuming $montant is numeric
$m = sprintf('€ %6.2f",$montant); // to nice currency string
}else{
$m='';
}
print("<tr>
<td align=\"center\">$quantite1</td>
<td align=\"right\">$m</td>
</tr>");
}
--
PETER FOX Not the same since the e-commerce business came to a .
peterfox@eminent.demon.co.uk.not.this.bit.no.html
2 Tees Close, Witham, Essex.
Gravity beer in Essex <http://www.eminent.demon.co.uk>
Navigation:
[Reply to this message]
|