Taille de colonne

Résolu/Fermé
Tydher Messages postés 123 Date d'inscription vendredi 5 juin 2009 Statut Membre Dernière intervention 17 mai 2011 - 16 juin 2009 à 11:18
Tydher Messages postés 123 Date d'inscription vendredi 5 juin 2009 Statut Membre Dernière intervention 17 mai 2011 - 16 juin 2009 à 12:08
Bonjour
J'ai un tableau qu'un scrip php m'affiche et je voudrais dimensionner les colonnes mais impossible de trouver quoi faire :
Voila mon tableau :
echo '<table align="center" border="1" width="75%">';
echo '<caption> Aperçu';
echo '</caption>';
echo '<tr>';
echo '<td>';
echo 'NETAB';
echo '</td>';
echo '<td>';
echo 'Nom Etablissement';
echo '</td>';
echo '<td>';
echo 'Nb Contacts';
echo '</td>';
echo '</tr>';
echo '</table>';

while ($data = mysql_fetch_row($req))
{
//Tableau
echo '<table align="center" border="1" width="65%">';
echo "<tr>";
echo "<td>";
echo $data[0];
echo "</td>";
echo "<td>";
echo $data[1];
echo "</td>";
echo "<td>";
echo $data[2];
echo "</td>";
echo "</tr>";
echo "</table>";

}

2 réponses

Ozimandias Messages postés 502 Date d'inscription jeudi 14 mai 2009 Statut Membre Dernière intervention 10 mars 2010 46
16 juin 2009 à 12:04
Tu dois donner une valeur à height ou width suivant que tu veux formater la largeur ou la hauteur. Tu peux faire comme suit:

echo '<td style="width: lalargeuricipx; height: la hauteuricipx">';
echo 'NETAB';
echo '</td>'; 
0
Tydher Messages postés 123 Date d'inscription vendredi 5 juin 2009 Statut Membre Dernière intervention 17 mai 2011 6
16 juin 2009 à 12:08
Ha ok c'est bon merci de vos reponses
0