1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
| function tablo($tab,$nbRow)
{
$parite=1;
// Description du tableau
echo '<table cellspacing="0" align=center>';
// On génère le titre du tableau. i.e. la premiere ligne avec image de fond plus les autres.
while(list($cle,$val) = each($tab))
{
if (substr($cle, 0, 6) == 'entete')
{
echo '<tr>';
echo '<th colspan="'.$nbRow.'" class="htTab">'.$val.'</th>';
echo '</tr>';
}
if (substr($cle, 0, 8) == 'RedTitle')
{
// echo '<tr bgcolor=#990000>
echo '<tr class="RedTitle">';
echo '<th colspan="'.$nbRow.'">'.$val.'</th>';
echo '</tr>';
}
if (substr($cle, 0, 10) == 'GreenTitle')
{
$nbrSousColonnes = count($val);
echo '<tr class="GreenTitle">';
while(list($cle2,$column) = each($val))
{
if ($nbRow == $nbrSousColonnes)
{
echo '<th>'.$column.'</th>';
}else
{
echo '<td colspan="'.$nbRow.'">'.$column.'</td>';
}
}
echo '</tr>';
}
if (substr($cle, 0, 8) == 'CorpsTab')
{
$parite *= -1;
$nbrSousColonnes = count($val);
if ($parite == 1)
{
$color = '66ff66';
$class = 'CorpsTabA';
} else
{
$color = '33ff33';
$class = 'CorpsTabB';
};
// echo '<tr bgcolor=#'.$color.'>';
echo '<tr class="'.$class.'">';
while(list($cle3,$column2) = each($val))
{
if ($nbRow == $nbrSousColonnes)
{
echo '<td>'.$column2.'</td>';
} else
{
echo '<td colspan="'.$nbRow.'">'.$column2.'</td>';
}
}
echo '</tr>';
}
if (substr($cle, 0, 8) == 'Intercal')
{
echo '<tr class="Intercal">';
echo '<td colspan="'.$nbRow.'"><strong>'.$val.'</strong></td>';
echo '</tr>';
}
}
echo '<tr>';
echo '<th colspan="'.$nbRow.'" class="basTab"> </th>';
echo '</tr>';
echo '</table>';
} |
Partager