HTML/Tableau/Espaces autour d'une image

Résolu/Fermé
alexou1984 Messages postés 375 Date d'inscription mardi 13 mai 2008 Statut Membre Dernière intervention 15 février 2010 - 21 sept. 2008 à 03:24
 Igoromus - 10 avril 2009 à 23:19
Bonjour,

J'ai créé un tableau dans lequel se trouve une photo. Je n'arrive pas à faire en sorte que les bords du tableau collent à ceux de la photo. Il y a toujours un espace assez conséquent sous la photo. Je pense avoir tout essayé : marginheight ; valign ; cellpadding... ect. Je ne sais plus quoi faire. Quelqu'un peut-il m'aider ?

Voici mon code :

<center>
<table border="1" bordercolor="#0011ee">
<center>
<tr>
<center>
<td>
<center>
<a href="a.html">
<img src="a.jpg" width="100">
</a>
</center>
</td>
</center>
</tr>
</center>
</table>
</center>

Merci d'avance.
A voir également:

6 réponses

2
alexou1984 Messages postés 375 Date d'inscription mardi 13 mai 2008 Statut Membre Dernière intervention 15 février 2010 35
21 sept. 2008 à 15:14
Merci beaucoup pour ces réponses. Juste une question, le "no-repeat" et le "text-align:center" servent à quoi ? "text-align:center" c'est pour centrer l'image c'est ça ?
0
zzzrod Messages postés 28 Date d'inscription samedi 20 septembre 2008 Statut Membre Dernière intervention 13 novembre 2011 3
21 sept. 2008 à 20:09
Avec 'no-repeat' l'image ne répète pas (parce qu'elle est comme le fond/background du div).
Et 'text-align:center' c'est pour aligner le TEXT au centre du div non l'image.
Pour aligner l'image faites ça:
<div style="background:url(a.jpg) no-repeat; border:1px solid #000000; height:100px; width:150px; text-align:center;" onclick="javascript:window.location='a.html';" ALIGN='CENTER'></div>

Ou avec une table:

<table align='center'>
<tr>
<td>
<div style="background:url(a.jpg) no-repeat; border:1px solid #000000; height:100px; width:150px; text-align:center;" onclick="javascript:window.location='a.html';"></div>
</td>
</tr>
</table>

Je vous suggère ces sites:
https://www.cssdebutant.com/
http://www.cssplay.co.uk
0
alexou1984 Messages postés 375 Date d'inscription mardi 13 mai 2008 Statut Membre Dernière intervention 15 février 2010 35
22 sept. 2008 à 01:21
Merci beaucoup pour les réponses.
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
zzzrod Messages postés 28 Date d'inscription samedi 20 septembre 2008 Statut Membre Dernière intervention 13 novembre 2011 3
21 sept. 2008 à 04:09
<table border="0" cellpadding='0' cellspacing='0'>
ou
<table border="1" bordercolor="#0011ee" cellpadding='0' cellspacing='0'>

et aussi:

<table border="1" bordercolor="#0011ee" align="center" cellpadding="0" cellspacing="0">
<tr>
<td>
<div style="background:url(a.jpg) no-repeat;" onclick="javascript:window.location='a.html';" align="center">
</td>
</tr>
</table>
-1
zzzrod Messages postés 28 Date d'inscription samedi 20 septembre 2008 Statut Membre Dernière intervention 13 novembre 2011 3
21 sept. 2008 à 04:11
tu peux faire la même chose sans une table:

<div style="background:url(a.jpg) no-repeat; border:1px solid #000000; height:100px; width:150px; text-align:center;" onclick="javascript:window.location='a.html';"></div>
-1