Combinaison td.colspan & tr.display:block
Bonjour à tous.
Voici un bout de code donnant des résultats différents sous IE7 d'une part, et sous Firefox3, Opera9, GoogleChrome-beta d'autre part :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
<html xml:lang="fr" xmlns="http://www.w3.org/1999/xhtml" lang="fr">
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<style type="text/css">
.line_one { background : lime; }
.line_two {background : red; }
</style>
</head>
<body>
<table>
<tr class="line_one">
<td>colonne 1</td>
<td>colonne 2</td>
</tr>
<tr class="line_two" style="display: block;">
<td colspan="2">7777777777777777777</td>
</tr>
</table>
</body>
</html> |
Si j'enlève le display:block sur le tr, l'affichage est correct partout : la deuxième ligne s'étend sur toute la largeur du tableau. Si je le laisse, sous FF &co, la deuxième ligne ne s'étend que sur la largeur d'une colonne. Pourquoi ??? 8O