IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

HTML Discussion :

Tableaux décalés


Sujet :

HTML

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Opo
    Opo est déconnecté
    Membre averti
    Inscrit en
    Juillet 2002
    Messages
    35
    Détails du profil
    Informations forums :
    Inscription : Juillet 2002
    Messages : 35
    Par défaut Tableaux décalés
    Bonjour j'ai un souci de décalage de colonnes ds 2 tableaux :
    Je m'explique :
    2 tableaux que je veux mettre l'un en dessous de l'autre (pour que les colonnes correspondent) le deuxième sera inclus ds un DIV pour pouvoir scroller (d'où le besoin de dexu tableaux) :
    Définition du 1er :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
     
    <%
    ' Définition de la taille des colonnes
    TAILLE_COL_NOM_PROJET = 350
    TAILLE_COL_SITE = 40
    TAILLE_COL_C16 = 200
    TAILLE_COL_TOTAL = 30
    TAILLE_COL_JOUR = 14
     
    <% 'ENTETE DU TABLEAU %>
    <table id="MainTable" width="<%=15+TAILLE_COL_NOM_PROJET+TAILLE_COL_SITE+TAILLE_COL_C16+TAILLE_COL_TOTAL+TOTAL_TAILLE_COL_JOURS+15%>" border="0" cellpadding="0" cellspacing="1">
     
     
    <% '1ERE LIGNE DE L'ENTETE DU TABLEAU %>
    <% 'CONTIENT LES NOMS DE JOUR         %>
    <tr>
    	<td width="15" rowspan="3" valign="top" </td>
    	<td width="<%=TAILLE_COL_NOM_PROJET+TAILLE_COL_SITE+TAILLE_COL_C16+TAILLE_COL_TOTAL%>" colspan="4">&nbsp;</td>
    <%while not RJour.eof%>
    <td width="<%=TAILLE_COL_JOUR%>" class="TableauTitrePetit"><%=RJour("JOUR_SEM")%></td>
    <%RJour.movenext
    wend%>
    <td width="15" rowspan="3" valign="top" class="TableauTitrePetit"></td>
    </tr>
     
    <% '2EME LIGNE DE L'ENTETE DU TABLEAU %>
    <% 'CONTIENT LES NUMEROS DE JOUR      %>
    <tr>
    <%
    RJour.movefirst
    TOTAL_HEURES_MOIS = 0
    while not RJour.eof
    %>
    <td width="<%=TAILLE_COL_JOUR%>" class="TableauTitrePetit"><%=RJour("NUM_JOUR")%></td>
    <%TOTAL_HEURES_MOIS = TOTAL_HEURES_MOIS + RJour("HEURES_MAX")
    RJour.movenext
    wend
    %>
    </tr>
     
    <% '3EME LIGNE DE L'ENTETE DU TABLEAU %>
    <% 'CONTIENT LES ENTETE DE COLONNES   %>
    <tr>
    <td width="<%=TAILLE_COL_NOM_PROJET%>" Nom projet</td>
    <td width="<%=TAILLE_COL_SITE%>" Site</td>
    <td width="<%=TAILLE_COL_C16%>"Code projet</td>
    <td width="<%=TAILLE_COL_TOTAL%>"<%=TOTAL_HEURES_MOIS%></td>
    <%
    RJour.movefirst
    while not RJour.eof
    %>
    <td width="<%=TAILLE_COL_JOUR%>" <%=RJour("HEURES_MAX")%></td>
    <%
    RJour.movenext
    wend%>
    </tr>
     
    </table>


    Définition du 2ème :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
     
    <table id="ViewTable" colspan=<%=6+iNbJourPeriode%>  width="<%=15+TAILLE_COL_NOM_PROJET+TAILLE_COL_SITE+TAILLE_COL_C16+TAILLE_COL_TOTAL+TOTAL_TAILLE_COL_JOURS+15%>" border="0" cellpadding="0" cellspacing="1">
     
     
    <% 'LIGNES DE PROJETS %>
    <tr>
    <td width="15" class="<%=VarClass%>"></td>
    <td width="<%=TAILLE_COL_NOM_PROJET%>"><%=trim(RActivite("NOM_PROJET"))%></td> 
    <td width="<%=TAILLE_COL_SITE%>"><%=trim(RActivite("NOM_SITE"))%></td>
    <td width="<%=TAILLE_COL_C16%>"><%=Code_Projet%></td> 
    <td width="<%=TAILLE_COL_TOTAL%>"<%=RActivite("TOTAL_MOIS")%></td> 
    <%
    ' Affichage des valeurs par jour
    RJour.movefirst
    while not RJour.eof
    <td width="<%=TAILLE_COL_JOUR%>"<%=RActivite("J_" & right("0" & trim(RJour("NUM_JOUR")),2))%></td>
    RJour.movenext
    wend
    %>
    <td width="15">&nbsp;</td>
     
    </tr>
    </table>

    Le souci c'est que mes colonnes ne tombent pas "en face".. elles sont décalées !!! quelqu'un verrait-il pourquoi ?
    Merci de vos réponses

  2. #2
    Membre Expert
    Avatar de trotters213
    Profil pro
    Inscrit en
    Janvier 2005
    Messages
    2 571
    Détails du profil
    Informations personnelles :
    Âge : 39
    Localisation : France, Gard (Languedoc Roussillon)

    Informations forums :
    Inscription : Janvier 2005
    Messages : 2 571
    Par défaut

    tu pourrais nous montrer le code généré plutôt que le code ASP ?

  3. #3
    Opo
    Opo est déconnecté
    Membre averti
    Inscrit en
    Juillet 2002
    Messages
    35
    Détails du profil
    Informations forums :
    Inscription : Juillet 2002
    Messages : 35
    Par défaut
    Pas de souci...
    je me suis même fait un exemple, reproduisant le même pb en HTML "simplifié" !
    Si vous avez une idée, surtout n'hésitez pas !
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
     
     
    <html>
    <head>
    <title>test</title>
    </head>
     
    <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
    <br>
    <form name="FormTitle" method="get">
     
    <br>
    <table id="MainTable" width="1070" border="1" cellpadding="0" cellspacing="1">
    <tr>
    	<td width="15" valign="top" >&nbsp;&nbsp;</td>
    	<td width="350">1er tableau</td>
    	<td width="40" >Site</td>
    	<td width="200" >Code projet</td>
    	<td width="30" >156</td>
    	<td width="14" >me</td>
    	<td width="14" >je</td>
    	<td width="14" >ve</td>
    	<td width="14" >sa</td>
    	<td width="14" >di</td>
    	<td width="14" >lu</td>
    	<td width="14" >ma</td>
    	<td width="14" >me</td>
    	<td width="14" >je</td>
    	<td width="14" >ve</td>
    	<td width="14" >sa</td>
    	<td width="14" >di</td>
    	<td width="14" >lu</td>
    	<td width="14" >ma</td>
    	<td width="14" >me</td>
    	<td width="14" >je</td>
    	<td width="14" >ve</td>
    	<td width="14" >sa</td>
    	<td width="14" >di</td>
    	<td width="14" >lu</td>
    	<td width="14" >ma</td>
    	<td width="14" >me</td>
    	<td width="14" >je</td>
    	<td width="14" >ve</td>
    	<td width="14" >sa</td>
    	<td width="14" >di</td>
    	<td width="14" >lu</td>
    	<td width="14" >ma</td>
    	<td width="14" >me</td>
    	<td width="14" >je</td>
    	<td width="15" valign="top" >&nbsp;&nbsp;</td>
    </tr>
    </table>
     
    <div class="GrilleConsultation">
    <table id="ViewTable" width="1070" border="1" cellpadding="0" cellspacing="1">
    <tr>
    	<td width="15" valign="top" >&nbsp;&nbsp;</td>
    	<td width="350" >2ème tableau</td>
    	<td width="40" >Site</td>
    	<td width="200" >Code projet</td>
    	<td width="30" >156</td>
    	<td width="14" >0</td>
    	<td width="14" >8</td>
    	<td width="14" >5</td>
    	<td width="14" >0</td>
    	<td width="14" >0</td>
    	<td width="14" >8</td>
    	<td width="14" >8</td>
    	<td width="14" >8</td>
    	<td width="14" >8</td>
    	<td width="14" >5</td>
    	<td width="14" >0</td>
    	<td width="14" >0</td>
    	<td width="14" >8</td>
    	<td width="14" >8</td>
    	<td width="14" >8</td>
    	<td width="14" >8</td>
    	<td width="14" >5</td>
    	<td width="14" >0</td>
    	<td width="14" >0</td>
    	<td width="14" >8</td>
    	<td width="14" >8</td>
    	<td width="14" >8</td>
    	<td width="14" >8</td>
    	<td width="14" >5</td>
    	<td width="14" >0</td>
    	<td width="14" >0</td>
    	<td width="14" >8</td>
    	<td width="14" >8</td>
    	<td width="14" >8</td>
    	<td width="14" >8</td>
    	<td width="15" valign="top" >&nbsp;&nbsp;</td>
    </tr>
    </table>
    <br>
     
    </div>
    </form>
     
     
     
    </body>
    </html>

  4. #4
    Modérateur
    Avatar de Bisûnûrs
    Profil pro
    Développeur Web
    Inscrit en
    Janvier 2004
    Messages
    9 931
    Détails du profil
    Informations personnelles :
    Âge : 42
    Localisation : France, Rhône (Rhône Alpes)

    Informations professionnelles :
    Activité : Développeur Web

    Informations forums :
    Inscription : Janvier 2004
    Messages : 9 931
    Par défaut
    Je vois que mon MP n'a servi à rien vu que le premier post n'est pas modifié ...

    Pour répondre à ta question, c'est normal que ça fasse ça. Tu donnes une taille de 14 pixels à tes cellules, mais le contenu dépasse les 14 pixels, donc empiète sur les autres cellules.

    Agrandis tes cellules et ça sera bon ...

  5. #5
    Membre Expert
    Avatar de trotters213
    Profil pro
    Inscrit en
    Janvier 2005
    Messages
    2 571
    Détails du profil
    Informations personnelles :
    Âge : 39
    Localisation : France, Gard (Languedoc Roussillon)

    Informations forums :
    Inscription : Janvier 2005
    Messages : 2 571
    Par défaut
    autre chose, au lieu de définir dans toutes tes cellules une largeur(ce qui est super lourd et surtout ingérable en cas de MàJ) tu peux utiliser uune classe, voir mieux un id sur ton tableau et traiter les enfants de cet id.

  6. #6
    Opo
    Opo est déconnecté
    Membre averti
    Inscrit en
    Juillet 2002
    Messages
    35
    Détails du profil
    Informations forums :
    Inscription : Juillet 2002
    Messages : 35
    Par défaut
    Merci pour vos réponses !!
    Le décalage venait également du fait que le Width était défini au niveau du tableau lui même !
    En tout cas, maintenant mes colonnes sont d'aplomb !
    Encore merci !!!

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. les tableaux décalés
    Par elodi333 dans le forum Débuter
    Réponses: 5
    Dernier message: 22/03/2008, 23h00
  2. free sur des tableaux "a moitié dynamiques"
    Par barthelv dans le forum C
    Réponses: 4
    Dernier message: 31/07/2003, 15h30
  3. [langage] erreurs utilisation tableaux 2 dimensions
    Par drosof dans le forum Langage
    Réponses: 11
    Dernier message: 01/07/2003, 11h44
  4. Réponses: 6
    Dernier message: 04/04/2003, 15h28
  5. Les tableaux en PL/SQL
    Par GRUMLY dans le forum PL/SQL
    Réponses: 5
    Dernier message: 12/08/2002, 18h10

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo