modifique tu codigo asi y ya me lo muestra como deseas....
Código PHP:
Ver original<?php
$host = "localhost"; //database location
$user = "root"; //database username
$pass = "6421285"; //database password
$db_name = "ferreteria"; //database name
//sets encoding to utf8
//mysql_query("SET NAMES utf8");
$sql2="SELECT * FROM producto ORDER BY codigo asc";
$tabla_apelacio=' <table cellpadding="0" cellspacing="0" width="550" style="font-size:11px;">';
$tabla_apelacio.='<thead style="font-weight:bold;">
<tr>
<td align="left" >Nombre Asesor.</td><td>Ciclo 1</td><td >Ciclo 2</td><td >Ciclo 3</td><td>Ciclo 4</td>
</tr>
</thead><tbody>';
$tabla_apelacio.='<tr>';
if($row2[2]==3)
{
$tabla_apelacio.='<td align="left" >'.$row2[0].'</td>';
$tabla_apelacio.='<td >'.$row2[1].'</td>';
}
if($row2[2]==3)
{
$tabla_apelacio.='<td >'.$row2[2].'</td>';
}
}
$tabla_apelacio.='</tr>';
$tabla_apelacio.='</tbody></table>';
echo $tabla_apelacio;
?>
adaptalo a tu BD y eso... saludos espero te sirva