Page 1 sur 1

alignement vertical d'un tableau

Posté : 09 mars 2006, 16:36
par Sims
bonjour a tous,

j'ai un petit problème avec un tableau que j'aimerai bien centrer verticalement dans ma page..
pour ca je l'ai inclus dans un tableau a une seule case avec width="100%" et height="100%".... le problème est que le tableau ne s'affiche pas correctement il ne prend pas 100% de la hauteur disponible....
quelqu'un connaît-il la réponse à ce mystère?

merci a tous ceux qui auront lu et surtout a tous ceux qui vont répondre

exemple sur http://www.kingtee.fr

CODE :

Code : Tout sélectionner

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>KingTee.fr Original T-shirts</title> <link href="kingtee.css" rel="stylesheet" type="text/css" /> <style type="text/css"> <!-- .Style1 { color: #FFFFFF; font-size: 10px; } --> </style> </head> <body scroll="no"> <table width="100%" height="100%" border="1"> <tr> <td> <table width="790" height="615" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#E4E6C8"> <tr> <td width="250" valign="top"><div align="center"><img src="pix/logomenu.gif" width="250" height="290" /><br /> <a href="index.php?page=collection"><img src="pix/btcollection.gif" width="250" height="61" border="0" /></a><br /> <a href="index.php?page=qualite"><img src="pix/btqualite.gif" width="250" height="90" border="0" /></a><br /> <a href="index.php?page=caddie"><img src="pix/btcaddy.gif" width="250" height="49" border="0" /></a><br /> <a href="mailto:[email protected]"><img src="pix/btcontact.gif" width="250" height="55" border="0" /></a><br /> <img src="pix/footmenu.gif" width="250" height="55" /><br /> <a href="partenaires.html" class="Style1">Nos Partenaires</a> <br /> </div></td> <td width="540" align="left" valign="middle"> <div align="left"> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="520" height="404"> <param name="movie" value="images/intro.swf"> <param name="quality" value="high"> <embed src="pix/intro.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="520" height="404"></embed> </object> </div> </td> </tr> </table> </td> </tr> </table> </body> </html>

Posté : 09 mars 2006, 17:50
par Victor BRITO
Salut!

Essaie de paramétrer la balise <table> en CSS, en indiquant le positionnement absolu du tableau. En gros, si je ne dis pas une bêtise:

Code : Tout sélectionner

table{ position: absolute; width: 100%; height: 100%; left: 0px; right: 0px; top: 0px; bottom: 0px; }

Posté : 09 mars 2006, 19:38
par Cyrano
Le même sans tableau :

Code : Tout sélectionner

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>KingTee.fr Original T-shirts</title> <link href="kingtee.css" rel="stylesheet" type="text/css" /> <style type="text/css"> <!-- .Style1 { color: #FFFFFF; background-color: inherit; font-size: 10px; } #blocpage { width: 790px; height: 615px; position: absolute; left: 50%; margin-left: -395px; color: inherit; background-color: #e4e6c8; } #menu { float: left; text-align: center; } #contenu object { position: relative; top: 50%; margin-top: -202px; } --> </style> </head> <body scroll="no"> <div id="blocpage"> <div id="menu"> <img src="pix/logomenu.gif" width="250" height="290" /><br /> <a href="index.php?page=collection"><img src="pix/btcollection.gif" width="250" height="61" border="0" /></a><br /> <a href="index.php?page=qualite"><img src="pix/btqualite.gif" width="250" height="90" border="0" /></a><br /> <a href="index.php?page=caddie"><img src="pix/btcaddy.gif" width="250" height="49" border="0" /></a><br /> <a href="mailto:[email protected]"><img src="pix/btcontact.gif" width="250" height="55" border="0" /></a><br /> <img src="pix/footmenu.gif" width="250" height="55" /><br /> <a href="partenaires.html" class="Style1">Nos Partenaires</a><br /> </div> <div id="contenu"> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="520" height="404"> <param name="movie" value="images/intro.swf"> <param name="quality" value="high"> <embed src="pix/intro.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="520" height="404"></embed> </object> </div> </div> </body> </html>