Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
2679 connectés 

  FORUM HardWare.fr
  Programmation
  HTML/CSS

  mail html tableau décalé

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

mail html tableau décalé

n°2199579
ccgo
Posté le 07-08-2013 à 01:39:06  profilanswer
 

Bonjour,
 
Je suis en train de réaliser un mail html pour demarcher avec mon groupe, et donc après avoir fait mes recherches sur les syntaxes, façons de le faire j'en arrive à ça :
 
 
 
<!-- Main table-->
 
<table width="100%" height="100%" cellpadding="0" style="padding: 20px 0px 20px 0px; background-color:#555555;">
<tbody><tr align="center"><td>
 
 
 
 
<!-- Header -->
 
 
<table cellpadding="0" cellspacing="0" width="800">
<tbody>
<tr>
<td valign="middle" style="width:400px;" background="http://static.wixstatic.com/media/470c77_1ff48e7d4bfc96c8d56709e23718fa96.jpg">
<img src="http://static.wixstatic.com/media/470c77_278241bae365f9fab383afa0479bdf65.png" width="370">
</td>
 
<td valign="middle" style="width:400px; background-color:#15203E;">
<img src="http://static.wixstatic.com/media/470c77_8342f2a391cbd685208888dd90d7c06b.jpg" width="400">
</td>
</tr>
</tbody>
</table>
 
<!-- Fin Header -->
 
<!-- Intérieur -->
 
<table width="800" cellpadding="0" cellspacing="0" style="color:#ffffff;">
<tbody>
<tr>
<td align="center" valign="middle" style="width:400px; color:#000000; font-size:13px; padding:25px 25px 25px 25px; text-align:justify; line-height:25px;" background="http://static.wixstatic.com/media/470c77_1ff48e7d4bfc96c8d56709e23718fa96.jpg">
 
<p>Gravity Off est un groupe de rock originaire de Paris formé en 2008. Le mélange des voix et des instruments donne naissance à des arrangements riches et colorés qui rendent les compositions de Gravity Off si efficaces.<br /><br />
 
Gravity Off c’est une heure de show, un groupe idéal pour les programmations rock et les premières parties. <br /><br />
 
<div align="center" style="font-size:16px;"><a href="http://www.gravity-off.com/">www.gravity-off.com</a></div></p>
</td>
 
<td align="center" valign="middle" style="width:400px; background-color:#536375; color:#15203e; font-size:13px; padding:25px 25px 25px 25px; text-align:justify; line-height:25px;">
 
<p>Across The Other Moon est un groupe de rock français formé en 2007.
<br /><br />Présentant des compositions originales, mélodiques et rythmées, ATOM saura vous faire vibrer dès les premières notes.
La formation est composée de 4 membres: 2 Guitares/ Chant , Basse, Batterie.<br />
<br />
<div align="center" style="font-size:16px;"><a href="http://www.acrosstheothermoon.com/">www.acrosstheothermoon.com</a></div></p>
 
</td>
</tr>
</tbody>
</table>
 
<!-- Fin Intérieur -->
 
 
<!-- Liens -->
 
<table width="800" cellpadding="0" cellspacing="0" style="color:#ffffff;">
<tbody>
<tr>
 
<td align="center" valign="top" style="width:400px;" background="http://static.wixstatic.com/media/470c77_1ff48e7d4bfc96c8d56709e23718fa96.jpg">
 
<table width="400" style="padding: 0px 33px 33px 33px">
 
<tbody>
<tr align="center">
 
<td align="left">
<a href="https://soundcloud.com/gravity-off"><img src="http://www.iconsdb.com/icons/preview/000000/soundcloud-3-xxl.png" title="Soundcloud" alt="soundcloud" width="100"></a>
</td>
 
<td align="center">
<a href="http://www.facebook.com/gravityoffofficial"><img src="http://www.iconsdb.com/icons/preview/000000/facebook-3-xxl.png" title="Facebook" alt="facebook" width="100"></a>
</td>
 
<td align="right">
<a href="https://www.youtube.com/user/GravityOffofficial"><img src="http://www.iconsdb.com/icons/preview/000000/youtube-3-xxl.png" title="Youtube" alt="youtube" width="100"></a>
</td>
 
</tr>
</tbody>
</table>
 
</td>
 
 
 
<td align="center" valign="top" style="width:400px; background-color:#536375;">
 
<table width="400" style="padding: 0px 33px 33px 33px">
<tbody>
<tr align="center">
 
<td align="left">
<a href="https://soundcloud.com/acrosstheothermoon"><img src="http://www.iconsdb.com/icons/preview/15203E/soundcloud-3-xxl.png" title="Soundcloud" alt="soundcloud" width="100"></a>
</td>
 
<td align="center">
<a href="http://www.facebook.com/acrosstheothermoon"><img src="http://www.iconsdb.com/icons/preview/15203E/facebook-3-xxl.png" title="Facebook" alt="facebook" width="100"></a>
</td>
 
<td align="right">
<a href="https://www.youtube.com/acrosstheothermoon"><img src="http://www.iconsdb.com/icons/preview/15203E/youtube-3-xxl.png" title="Youtube" alt="youtube" width="100"></a>
</td>
 
</tr>
</tbody>
</table>
 
</td>
 
</tr>
</tbody>
</table>
 
<!-- Fin Liens -->
 
 
<!-- Photos fin -->
 
<table cellpadding="0" cellspacing="0" width="800">
<tbody>
<tr>
<td valign="bottom" style="width:400px;" background="http://static.wixstatic.com/media/470c77_1ff48e7d4bfc96c8d56709e23718fa96.jpg">
<img src="http://static.wixstatic.com/media/470c77_233eb630d65f34a2ca4db4d0cc4af5cd.jpg" width="400" align="bottom">
</td>
 
<td valign="middle" style="width:400px; background-color:#15203E;">
<img src="http://static.wixstatic.com/media/470c77_8342f2a391cbd685208888dd90d7c06b.jpg" width="400">
</td>
</tr>
</tbody>
</table>
 
<!-- Fin Photos Fin -->
 
</td></tr></tbody></table>
 
 
Donc c'est ce que je voulais dans l'ensemble. Sauf que le tableau qui contient le texte est décalé au centre par rapport au reste des tableaux. J'ai regardé cent fois d'où ça pouvait venir, s'il y avait pas un caractère manquant etc. Je n'arrive absolument pas à trouver d'où vient le problème.
 
Votre oeil ou vos connaissances aiguisées m'aideront !
 
Merci d'avance.
 
 

mood
Publicité
Posté le 07-08-2013 à 01:39:06  profilanswer
 

n°2199625
rufo
Pas me confondre avec Lycos!
Posté le 07-08-2013 à 14:57:52  profilanswer
 

Déjà, tu devrais commencer par optimiser tes images. une boîte qui m'envoie un mail de 18 Mo, elle est pas prête de me vendre qq chose :o
 
Pour ton pb, je pense que ça vient de tes 2 tableaux de 400px de large l'un à côté de l'autre qui pose soucis, sans doute à cause des marges par défaut qui viennent se rajouter...
 
Edit : pour mieux voir ce qui pose pb, tu devrais ajouter pour chaque zone une bordure d'1px d'une couleur différente pour visualiser jusqu'où va chaque tableau. Installer l'extension Firebug pour Firefox pourra t'aider aussi.


Message édité par rufo le 07-08-2013 à 14:59:30

---------------
Astres, outil de help-desk GPL : http://sourceforge.net/projects/astres, ICARE, gestion de conf : http://sourceforge.net/projects/icare, Outil Planeta Calandreta : https://framalibre.org/content/planeta-calandreta
n°2199626
rufo
Pas me confondre avec Lycos!
Posté le 07-08-2013 à 15:07:25  profilanswer
 

Bon, en fait, c'était tes padding 25px 25px 25px 25px qui foutaient la merde. Et oui, encore le pb du modèle boîte.
Chez Firefox, le width fait 400px avec un padding de 0. Si tu ajoutes du padding, la largeur résultante est width+padding-left+padding-right. Chez Internet explorer, c'est pas le cas, le width ne change pas, le padding réduit juste la large du contenu.
 
Conclusion : tu enlèves les paddings et sur tes balises à l'intérieur des <td> qui font 400px de large, tu mets des margin de 25px ;)
 
Edit : Voici le code modifié :

Code :
  1. <!-- Main table-->
  2.  
  3. <table width="100%" height="100%" cellpadding="0" style="padding: 20px 0px 20px 0px; background-color:#555555;">
  4. <tbody><tr align="center"><td>
  5.  
  6. <!-- Header -->
  7.  
  8. <table cellpadding="0" cellspacing="0" width="800">
  9. <tbody>
  10. <tr>
  11. <td valign="middle" style="width:400px;" background="http://static.wixstatic.com/media/470c77_1ff48e7d4bfc96c8d56709e23718fa96.jpg">
  12. <img src="http://static.wixstatic.com/media/470c77_278241bae365f9fab383afa0479bdf65.png" width="370">
  13. </td>
  14.  
  15. <td valign="middle" style="width:400px; background-color:#15203E;">
  16. <img src="http://static.wixstatic.com/media/470c77_8342f2a391cbd685208888dd90d7c06b.jpg" width="400">
  17. </td>
  18. </tr>
  19. </tbody>
  20. </table>
  21.  
  22. <!-- Fin Header -->
  23.  
  24. <!-- Intérieur -->
  25.  
  26. <table width="800" cellpadding="0" cellspacing="0" style="color:#ffffff;">
  27. <tbody>
  28. <tr>
  29. <td align="center" valign="middle" style="width:400px; color:#000000; font-size:13px; padding:0; text-align:justify; line-height:25px; margin: 0"  
  30. background="http://static.wixstatic.com/media/470c77_1ff48e7d4bfc96c8d56709e23718fa96.jpg">
  31.  
  32. <p style="margin: 25px;">Gravity Off est un groupe de rock originaire de Paris formé en 2008. Le mélange des voix et des instruments donne naissance à des  
  33. arrangements riches et colorés qui rendent les compositions de Gravity Off si efficaces.<br /><br />
  34.  
  35. Gravity Off c’est une heure de show, un groupe idéal pour les programmations rock et les premières parties. <br /><br />
  36.  
  37. <div align="center" style="font-size:16px;"><a href="http://www.gravity-off.com/">www.gravity-off.com</a></div></p>
  38. </td>
  39.  
  40. <td align="center" valign="middle" style="width:400px; background-color:#536375; color:#15203e; font-size:13px; padding:0; text-align:justify;  
  41. line-height:25px; margin: 0">
  42.  
  43. <p style="margin: 25px;">Across The Other Moon est un groupe de rock français formé en 2007.
  44. <br /><br />Présentant des compositions originales, mélodiques et rythmées, ATOM saura vous faire vibrer dès les premières notes.
  45. La formation est composée de 4 membres: 2 Guitares/ Chant , Basse, Batterie.<br />
  46. <br />
  47. <div align="center" style="font-size:16px;"><a href="http://www.acrosstheothermoon.com/">www.acrosstheothermoon.com</a></div></p>
  48.  
  49. </td>
  50. </tr>
  51. </tbody>
  52. </table>
  53.  
  54. <!-- Fin Intérieur -->
  55.  
  56.  
  57. <!-- Liens -->
  58.  
  59. <table width="800" cellpadding="0" cellspacing="0" style="color:#ffffff;">
  60. <tbody>
  61. <tr>
  62.  
  63. <td align="center" valign="top" style="width:400px;" background="http://static.wixstatic.com/media/470c77_1ff48e7d4bfc96c8d56709e23718fa96.jpg">
  64.  
  65. <table width="400" style="padding: 0px 33px 33px 33px">
  66.  
  67. <tbody>
  68. <tr align="center">
  69.  
  70. <td align="left">
  71. <a href="https://soundcloud.com/gravity-off"><img src="http://www.iconsdb.com/icons/preview/000000/soundcloud-3-xxl.png" title="Soundcloud" alt="soundcloud"  
  72. width="100"></a>
  73. </td>
  74.  
  75. <td align="center">
  76. <a href="http://www.facebook.com/gravityoffofficial"><img src="http://www.iconsdb.com/icons/preview/000000/facebook-3-xxl.png" title="Facebook"  
  77. alt="facebook" width="100"></a>
  78. </td>
  79.  
  80. <td align="right">
  81. <a href="https://www.youtube.com/user/GravityOffofficial"><img src="http://www.iconsdb.com/icons/preview/000000/youtube-3-xxl.png" title="Youtube"  
  82. alt="youtube" width="100"></a>
  83. </td>
  84.  
  85. </tr>
  86. </tbody>
  87. </table>
  88.  
  89. </td>
  90.  
  91.  
  92.  
  93. <td align="center" valign="top" style="width:400px; background-color:#536375;">
  94.  
  95. <table width="400" style="padding: 0px 33px 33px 33px">
  96. <tbody>
  97. <tr align="center">
  98.  
  99. <td align="left">
  100. <a href="https://soundcloud.com/acrosstheothermoon"><img src="http://www.iconsdb.com/icons/preview/15203E/soundcloud-3-xxl.png" title="Soundcloud"  
  101. alt="soundcloud" width="100"></a>
  102. </td>
  103.  
  104. <td align="center">
  105. <a href="http://www.facebook.com/acrosstheothermoon"><img src="http://www.iconsdb.com/icons/preview/15203E/facebook-3-xxl.png" title="Facebook"  
  106. alt="facebook" width="100"></a>
  107. </td>
  108.  
  109. <td align="right">
  110. <a href="https://www.youtube.com/acrosstheothermoon"><img src="http://www.iconsdb.com/icons/preview/15203E/youtube-3-xxl.png" title="Youtube" alt="youtube"  
  111. width="100"></a>
  112. </td>
  113.  
  114. </tr>
  115. </tbody>
  116. </table>
  117.  
  118. </td>
  119.  
  120. </tr>
  121. </tbody>
  122. </table>
  123.  
  124. <!-- Fin Liens -->
  125.  
  126.  
  127. <!-- Photos fin -->
  128.  
  129. <table cellpadding="0" cellspacing="0" width="800">
  130. <tbody>
  131. <tr>
  132. <td valign="bottom" style="width:400px;" background="http://static.wixstatic.com/media/470c77_1ff48e7d4bfc96c8d56709e23718fa96.jpg">
  133. <img src="http://static.wixstatic.com/media/470c77_233eb630d65f34a2ca4db4d0cc4af5cd.jpg" width="400" align="bottom">
  134. </td>
  135.  
  136. <td valign="middle" style="width:400px; background-color:#15203E;">
  137. <img src="http://static.wixstatic.com/media/470c77_8342f2a391cbd685208888dd90d7c06b.jpg" width="400">
  138. </td>
  139. </tr>
  140. </tbody>
  141. </table>
  142.  
  143. <!-- Fin Photos Fin -->
  144.  
  145. </td></tr></tbody></table>


Message édité par rufo le 07-08-2013 à 15:09:31

---------------
Astres, outil de help-desk GPL : http://sourceforge.net/projects/astres, ICARE, gestion de conf : http://sourceforge.net/projects/icare, Outil Planeta Calandreta : https://framalibre.org/content/planeta-calandreta
n°2199823
ccgo
Posté le 09-08-2013 à 15:47:36  profilanswer
 

Merci bien !
Effectivement finalement un ami m'a aidé entre temps.
Donc ouais le coup des padding, pas super comme solution. COmme je suis autodidacte je n'savais pas, et comme c'est marqué sur a peu près aucun site … Mais on apprend de ses erreurs.
 
Pour la taille des images, j'étais au fait, je me concentrais sur le code pour le moment, j'ai ensuite fait des versions réduites.

n°2199825
rufo
Pas me confondre avec Lycos!
Posté le 09-08-2013 à 16:26:13  profilanswer
 

Euh, le coup du pb du modèle boîte, si, c'est marqué sur pas mal de sites et c'est très connu comme pb :/


---------------
Astres, outil de help-desk GPL : http://sourceforge.net/projects/astres, ICARE, gestion de conf : http://sourceforge.net/projects/icare, Outil Planeta Calandreta : https://framalibre.org/content/planeta-calandreta

Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  HTML/CSS

  mail html tableau décalé

 

Sujets relatifs
remplir un tableau HTML avec des variables JSBugs sur un site jQuery/HTML
Reader Adobe PDF en local sur page HTMLProblème signature ds windows live mail
[JSF/HTML] Pb de mise en cache img,css, js par mon navigateurGénérer un fichier XML a partir de données HTML
(HTML) Alignement d'image.séparateur espace sélection tableau
Recherche de valeur dans un tableau dynamique 
Plus de sujets relatifs à : mail html tableau décalé


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR