Div ou Table, quel est votre avis ?

Div ou Table, quel est votre avis ? - HTML/CSS - Programmation

Marsh Posté le 03-07-2005 à 02:49:37    

Bonsoir, j'aurai juste besoin d'un petit conseil.
Je viens de crée un sondage php et je me tate a choisir table ou div pour afficher le résultat.
Je voulais juste savoir votre avis rapide.
 
Le fait de faire des Div reviendrai a la meme chose au niveau quantité code a quelques choses pret.
 
http://bibi35.free.fr/sondage/
 
Merci


Message édité par Badze le 03-07-2005 à 03:01:39
Reply

Marsh Posté le 03-07-2005 à 02:49:37   

Reply

Marsh Posté le 03-07-2005 à 05:29:59    

Ca :

Code :
  1. <form action="#" method="post">
  2. <fieldset>
  3.  <ul>
  4.   <li><label for="tb"><input type="radio" name="vote" id="tb" value="1">Très bien</label></li>
  5.   <li><label for="cv"><input type="radio" name="vote" id="cv" value="2">Ca va    </label></li>
  6.   <li><label for="b" ><input type="radio" name="vote" id="b"  value="3">Bof      </label></li>
  7.   <li><label for="m" ><input type="radio" name="vote" id="m"  value="4">Médiocre </label></li>
  8.  </ul>
  9. </fieldset>
  10. <fieldset>
  11.  <input type="submit">
  12. </fieldset>
  13. </form>
  14. <dl>
  15. <dt>Très bien</dt>
  16. <dd>
  17.  <img src="vote_lcap.gif" alt="" height="12" width="6" /><img src="voting_bar.gif" alt="" height="12" width="48" /><img src="vote_rcap.gif" alt="" height="12" width="6" />
  18.  24 %
  19. </dd>
  20. <dt>Ca va</dt>
  21. <dd>
  22.  <img src="vote_lcap.gif" alt="" height="12" width="6" /><img src="voting_bar.gif" alt="" height="12" width="24" /><img src="vote_rcap.gif" alt="" height="12" width="6" />
  23.  12 %
  24. </dd>
  25. <dt>Bof</dt>
  26. <dd>
  27.  <img src="vote_lcap.gif" alt="" height="12" width="6" /><img src="voting_bar.gif" alt="" height="12" width="36" /><img src="vote_rcap.gif" alt="" height="12" width="6" />
  28.  18 %
  29. </dd>
  30. <dt>Médiocre</dt>
  31. <dd>
  32.  <img src="vote_lcap.gif" alt="" height="12" width="6" /><img src="voting_bar.gif" alt="" height="12" width="94" /><img src="vote_rcap.gif" alt="" height="12" width="6" />
  33.  47 %
  34. </dd>
  35. </dl>


Message édité par afbilou le 03-07-2005 à 05:33:53
Reply

Marsh Posté le 03-07-2005 à 08:42:46    

bravo Abfilou, kler ke j'ai po trop compris pourquoi le mec à mis 50 TD lol

Reply

Marsh Posté le 03-07-2005 à 14:09:41    

Merci pour ce travail, je demandais juste conseil, c'est tout :).

Reply

Marsh Posté le 03-07-2005 à 15:04:55    


On pourrait encore améliorer le code [:aloy]  
 
1- Pas besoin de deux fieldsets
2- On peut ajouter une légende à l'unique fieldset du formulaire
3- Utiliser du PHP pour générer les images via GD
=>

<form action="#" method="post" name="poll">
    <fieldset>
        <legend>Sondage</legend>
         <ul>
             <li><label for="tb">Très bien </label><input type="radio" name="vote" id="tb" value="1"></li>
             <li><label for="cv">Ca va </label><input type="radio" name="vote" id="cv" value="2"></li>
             <li><label for="b" >Bof </label><input type="radio" name="vote" id="b"  value="3"></li>
             <li><label for="m" >Médiocre </label><input type="radio" name="vote" id="m"  value="4"></li>
         </ul>
         <input type="submit" name="submit" value="Voter"/>
         <input type="reset" name="reset" value="Annuler"/>
    </fieldset>
</form>
<h2>Résultats:</h2>
<dl>
    <dt>Très bien</dt>
    <dd><img src="results_image.php?value=24" alt=""/> 24%</dd>
    <dt>Bien</dt>
    <dd><img src="results_image.php?value=12" alt=""/> 12%</dd>
    <dt>Bof</dt>
    <dd><img src="results_image.php?value=18" alt=""/> 18%</dd>
    <dt>Médiocre</dt>
    <dd><img src="results_image.php?value=46" alt=""/> 46%</dd>
</dl>


Avec ici results_image.php qui va créer une image complète de la bonne taille en fonction de la value qui lui est passée [:dawa]
Comme ça pas besoin de s'emmerder à créer plein d'images et à étirer les machins [:dawa]


Message édité par masklinn le 03-07-2005 à 15:05:35

---------------
I mean, true, a cancer will probably destroy its host organism. But what about the cells whose mutations allow them to think outside the box, and replicate and expand beyond their wildest dreams by throwing away the limits imposed by overbearing genetic r
Reply

Marsh Posté le 03-07-2005 à 15:12:37    

Oui justement quand tu parle d'image php, je suis a la recherche d'un tuto qui me permettrai de faire afficher mon sondage en barre verticale.
Introuvable, je ne trouve que des Camemberts.
 
Un tuto complet par rapport a la librairie GD serait le tip top.
merci

Reply

Marsh Posté le 03-07-2005 à 15:24:21    

http://www.google.fr/search?hs=Kj3 [...] cher&meta=
[:spamafote]
 
http://www.nyphp.org/content/presentations/GDintro/ [:aloy]


Message édité par masklinn le 03-07-2005 à 15:25:13

---------------
I mean, true, a cancer will probably destroy its host organism. But what about the cells whose mutations allow them to think outside the box, and replicate and expand beyond their wildest dreams by throwing away the limits imposed by overbearing genetic r
Reply

Marsh Posté le 03-07-2005 à 15:28:38    

Merci, ralala, il faut vraiment que j'accroche l'anglais moi :p

Reply

Sujets relatifs:

Leave a Replay

Make sure you enter the(*)required information where indicate.HTML code is not allowed