View Single Post
Old 05-06-2010, 06:26 AM   #8
zelda_pinwheel
zeldinha zippy zeldissima
zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.
 
zelda_pinwheel's Avatar
 
Posts: 27,827
Karma: 921169
Join Date: Dec 2007
Location: Paris, France
Device: eb1150 & is that a nook in her pocket, or she just happy to see you?
bonjour agronomia, les conseils d'eowyn sont bons en général, et ça t'aidera surement de vérifier tes fichiers dans ADE si tu lis sur un sony.

un point à signaler, en général ça sera plus facile de t'aider si tu nous montres au moins une partie de ton code. par exemple, tu parles d'utiliser la balise align="center", est-ce que tu veux dire que tu as mis ça directement dans ton html ? il vaut mieux mettre toutes ces indications dans le css plutôt, en créant une class :

.center{
text-align:center;
}

il faudra appliquer cette class à l'élément qui contient ce que tu voudras centrer ; par exemple, si tu veux centrer le texte à l'intérieur d'un td, tu créeras un < td class="center" > si tu veux centrer ton tableau entier dans la page, tu pourras le mettre à l'intérieur d'une div, à laquelle tu appliqueras la class "center".

en l'occurrence, si tu veux centrer le table entier dans la page, en effet on dirait un bug étrange, ça ne marche pas uniquement en mettant le table à l'intérieur d'une div centrée, mais j'ai trouvé une solution ici (merci llasram) ; il faut donner à la div une règle de "display: inline-table" comme suit :

Code:
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title></title>
  
<style type="text/css">
.center {text-align:center;
        }

  #wrap > table {
     display: inline-table;
  }
</style>
</head>

<body>
  <div id="wrap" class="center">
    <table width="200" border="1">
      <tr>
        <td>table centré</td>
      </tr>
    </table>
  </div>
</body>
</html>
je joins un epub avec qqs exemples d'éléments centrés pour référence.
Attached Files
File Type: epub centertable.epub (1.9 KB, 1239 views)
zelda_pinwheel is offline   Reply With Quote