J'essaye de faire une opération très simple de fusionner deux colonnes dans une table. Cela semble facile avec le colspan, mais si je fusionne des colonnes différentes sans laisser au moins une ligne sans colonnes fusionnées, le dimensionnement est complètement foiré. S'il vous plaît voir l'exemple suivant à http://www.allthingsdope.com/table.html ou jeter un coup d'oeil et essayez le code suivant:Colonnes Spanning dans le tableau HTML
Bon:
<table width="700px">
<tr>
<th width="100px">1: 100px</th>
<td width="300px">2: 300px</td>
<td width="200px">3: 200px</td>
<td width="100px">4: 100px</td>
</tr>
<tr>
<th width="100px">1: 100px</th>
<td colspan=2 width="500px" >2 & 3: 500px</td>
<td width="100px">4: 100px</td>
</tr>
<tr>
<th width="100px">1: 100px</th>
<td width="300px">2: 300px</td>
<td colspan=2 width="300px">3 & 4: 300px</td>
</tr>
</table>
Bad:
<table width="700px">
<tr>
<th width="100px">1: 100px</th>
<td colspan=2 width="500px" >2 & 3: 500px</td>
<td width="100px">4: 100px</td>
</tr>
<tr>
<th width="100px">1: 100px</th>
<td width="300px">2: 300px</td>
<td colspan=2 width="300px">3 & 4: 300px</td>
</tr>
</table>
Cela semble si simple, mais je ne peux pas le comprendre !
Je contrôlais en fait toutes les largeurs avec CSS, mais j'aime aussi cette méthode. Merci pour l'info, j'essaie toujours d'être aussi à jour avec les normes que je peux être. – Tony
Compris. Les largeurs