Problème hauteur tableau

Résolu/Fermé
nlbmoi Messages postés 434 Date d'inscription samedi 26 août 2006 Statut Membre Dernière intervention 3 décembre 2023 - 5 août 2014 à 23:24
nlbmoi Messages postés 434 Date d'inscription samedi 26 août 2006 Statut Membre Dernière intervention 3 décembre 2023 - 6 août 2014 à 20:55
Bonjour,

Je souhaite créer un tableau sur un site : j'ai vu qu'il était préférable de mettre des valeurs de hauteur/largeur en % plutôt qu'en px pour permettre une vision Responsive du site. J'ai donc fait l'essai sur un tableau : autant pour la largeur, je n'ai pas de souci par contre pour la hauteur, j'ai quelques soucis. J'ai beau changer la valeur du pourcentage dans la balise table, cela ne change rien.
Je vous joins un bout du code :
<table border="1" width="80%" frame="void" rules="none" cellspacing="0">
<tbody>
<tr>
<th align="left" width="30%" height="20%"><strong>EQUIPES</strong></th>
<th align="left" width="20%"><strong>JOUR</strong></th>
<th align="left" width="25%"><strong>HORAIRES</strong></th>
<th align="left" width="25%"><strong>SALLE</strong></th>
</tr>
<tr>
<td align="left" height="8%"><strong>Baby</strong></td>
<td align="left">Samedi</td>
<td align="left">10h30 - 11h30</td>
<td align="left">Lieu 1</td>
</tr>
<tr>
<td align="left" height="8%"><strong>Ecole</strong></td>
<td align="left">Samedi</td>
<td align="left">10h30 - 12h</td>
<td align="left">Lieu 1</td>
</tr>
<tr>
<td align="left" height="8%"><strong>Minimes</strong></td>
<td align="left">Mercredi</td>
<td align="left">17h30 - 19h30</td>
<td align="left">Lieu 1</td>
</tr>


Si quelqu'un pouvait m'aider, ce serait sympa.

1 réponse

Lerendra Messages postés 408 Date d'inscription jeudi 26 septembre 2013 Statut Membre Dernière intervention 28 mai 2018 299
6 août 2014 à 15:14
Bonjour !

Autant je suis d'accord avec toi sur l'utilisation des "%" pour la longueur, mais pour la hauteur, cela ne sert à rien ! Et c'est normal que cela ne marche pas ! Si tu veux, pour ton
height
je te conseil de le faire en "px" !
Donc si on reprend ton code :
<table border="1" width="80%" frame="void" rules="none" cellspacing="0">
<tbody>
<tr>
<th align="left" width="30%" height="30px"><strong>EQUIPES</strong></th>
<th align="left" width="20%"><strong>JOUR</strong></th>
<th align="left" width="25%"><strong>HORAIRES</strong></th>
<th align="left" width="25%"><strong>SALLE</strong></th>
</tr>
<tr>
<td align="left" height="18px"><strong>Baby</strong></td>
<td align="left">Samedi</td>
<td align="left">10h30 - 11h30</td>
<td align="left">Lieu 1</td>
</tr>
<tr>
<td align="left" height="18px"><strong>Ecole</strong></td>
<td align="left">Samedi</td>
<td align="left">10h30 - 12h</td>
<td align="left">Lieu 1</td>
</tr>
<tr>
<td align="left" height="18px"><strong>Minimes</strong></td>
<td align="left">Mercredi</td>
<td align="left">17h30 - 19h30</td>
<td align="left">Lieu 1</td>
</tr>


Voilà ! :D Si tu as besoins d'autre chose, n'hésite pas !
Lerendra

1
nlbmoi Messages postés 434 Date d'inscription samedi 26 août 2006 Statut Membre Dernière intervention 3 décembre 2023 24
Modifié par nlbmoi le 6/08/2014 à 17:13
Bonjour

Merci pour ton aide.
Le fait de mettre une hauteur en pixel ne sera pas dérangeant si on regarde le site sur un mobile par exemple ?
L'utilisation des em est-il pertinente ?
0
Lerendra Messages postés 408 Date d'inscription jeudi 26 septembre 2013 Statut Membre Dernière intervention 28 mai 2018 299
6 août 2014 à 17:59
Non. Cela ne changera rien. Tu peux utiliser des
em
, mais cela revient à utiliser des
px
.
0
nlbmoi Messages postés 434 Date d'inscription samedi 26 août 2006 Statut Membre Dernière intervention 3 décembre 2023 24
6 août 2014 à 20:55
D'accord. Merci pour tout.
0