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

Mise en page CSS Discussion :

Affichage dans un tableau


Sujet :

Tableau en CSS

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre confirmé
    Profil pro
    Inscrit en
    Novembre 2007
    Messages
    74
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Novembre 2007
    Messages : 74
    Par défaut Affichage dans un tableau
    Bonjour à tous,
    j'ai 1 problèmes avec mon tableau html et ca fait pas mal de temps que je planche dessus sans trouver de solution.

    Alors voilà, dans ma page HTML j'ai un tableau de ce type:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    <script>
    mygrid = new dhtmlXGridObject("gridbox");
    mygrid.setImagePath("Images/imgstableau/");
    mygrid.setHeader("Column A, Column B, Column C, Column D, Column E");
    mygrid.setInitWidths("100,250,150,200,80")
    mygrid.setColAlign("center,center,center,center,center")
    mygrid.setColTypes("ro,ro,ro,ro,ro");
    mygrid.setColSorting("str,str,str,str,str")
    mygrid.setColumnColor('#33FFFF,#CCFFFF,#33FFFF,#CCFFFF,#33FFFF,#CCFFFF');
    mygrid.init();
    mygrid.loadXML("dontab/accueil.xml");
    </script>
    Il fait donc comme vous le voyez, appel à un fichier xml pour les données. Il fait également appel à une feuille de style .css:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <link rel="STYLESHEET" type="text/css" href="stylesheets/dhtmlXGrid.css">
    Donc un cas assez classique jusque là. Cependant je rencontre 1 problème majeur1:

    lors de l'affichage de ma page, lorsque le texte ne tiens pas dans une cellule du tableau, il est coupé au lieu de faire un retour à la ligne dans la cellule. Donc je voudrai soit faire un retour à la ligne automatique, soit régler la hauteur des cellules de mon tableau (la largeur est réglable grace à mygrid.setInitWidths("100,250,150,200,80") mais pour la hauteur je vois pas).

    Je pense donc qu'il y a des paramètres à changer dans le fichier css pour obtenir un affichage sur 2 lignes

    Merci

    Voici le code du fichier css:

    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
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    div.gridbox{
    	overflow:hidden;
    }
    div.gridbox table.hdr td {
    	font-family:arial;
    	font-size:12px;
    	background-Color:#0099CC;
    	border: 1px solid;
    	border-color : white Gray Gray white;
    	text-align: center;
    	margin:0px;
    	padding:5px 0px 5px 0px ;
    	font-weight:normal;
        -moz-user-select:none;
        overflow:hidden;
    	}
    div.gridbox table.hdr td div.hdrcell{
    	overflow:hidden;
    }
    div.gridbox table.obj td {
    	border: 1px solid;
    	border-color : white Gray Gray white;
    	font-family:Arial;
    	font-size:12px;
        -moz-user-select:none;
        overflow:hidden;
        padding-top:0px;
        padding-bottom:0px;
    	}
    div.gridbox table.obj th {
    	padding:0px 0px 0px 0px ;
    	margin:0px 0px 0px 0px ;
    	}
     
    div.gridbox table.row20px tr  td{
        height:20px;
        white-space: nowrap;
        padding:0px;
    }
    div.gridbox table.obj td span.space, div.gridbox table.obj td img.space{
    	width:18px;
    	}
    div.gridbox table.obj tr.rowselected td.cellselected, div.gridbox table.obj td.cellselected {
    	background-color:#339999;
    	color:black;
    	}
    div.gridbox table.obj tr.rowselected td{
    	background-color:#33CC99;
    	color:black;
    	}
    div.gridbox table.obj td.editable{
        -moz-user-select:text;
        }
     
    .dragSpanDiv{ 	font-size : 12px; 	border: 1px gray solid; background-color:white; }
    .dhx_combo_select{
        font-family:arial;
        font-size:12px;
        border:1px solid;
        border-color:black silver silver black;
        background-color:white;
        overflow:hidden;
        cursor:default;
        position:absolute;
        height:auto;
    }
    .dhx_combo_edit{
        width:100%;
        border:0px;
        padding:0px;
        margin:0px;
        font:12px arial;
        overflow:hidden;
    }
     
    .dhx_textarea{
        border:1px solid;
        border-color:black silver silver black;
        position:absolute;
    	height:100px;
    }
    .dhx_clist{
        background-color:white;
        border:1px solid black;
        padding:2px 2px 2px 2px;
    }
    .gridDragLine{
       position:absolute;
       top:10px; left:0px;
       width:100%;
       height:2px;
       background-color:black;
       overflow:hidden;
    }
     
    /*paginal output*/
    DIV.pagingBlock{
    	font-size:12px;
    	font-family:verdana,arial;
    }
    DIV.pagingBlock .pagingCurrentPage{
    	font-weight:bold;
    	cursor:default;
    }
    DIV.pagingBlock .pagingPage{
    	cursor:pointer;
    	text-decoration:underline;
    }
    SPAN.recordsInfoBlock {
    	font-size:12px;
    	font-family:verdana,arial;
    }
    /*class for toolbar selectbox. used with pagingWT*/
    .toolbar_select{
    	font-size:10px;
    }
     
    /*block selection style*/
    .dhtmlxGrid_selection {
       -moz-opacity: 0.5;
       filter: alpha(opacity = 50);
       background-color:yellow;
       opacity:0.5;
       border: 1px dotted black;
    }
     
    /* xp skin ------------------------------------------------------*/
    div.gridbox_xp{
    	border:1px solid lightgrey;
    }
    div.gridbox_xp table.hdr td {
    	color:#616161;
    	background-image:url('../imgs/header_bg_60.gif');
    	border:0px;
    	text-align: center;
    	margin:0px;
    	padding:5px 0px 5px 0px ;
    	font-weight:bold;
        -moz-user-select:none;
        overflow:hidden;
    	}
    div.gridbox_xp table.hdr td div.hdrcell{
    	border-left: 1px solid white;
    	border-right: 1px solid gray;
    	height:16px;
    	white-space : nowrap;
    	font-family:Arial;
    	font-size:12px;
    }
    div.gridbox_xp table.obj td {
    	border:0px;
    	border-bottom: 1px solid lightgrey;
    	border-right: 1px solid lightgrey;
    	font-family:Arial;
    	font-size:12px;
        -moz-user-select:none;
        overflow:hidden;
        padding-top:0px;
        padding-bottom:0px;
    	vertical-align:middle;
    	}
    div.gridbox_xp table.obj tr.rowselected td{
    	background-color:whitesmoke;
    	color:black;
    	}
    div.gridbox_xp table.obj tr.rowselected td.cellselected, div.gridbox table.obj td.cellselected {
    	background-color:whitesmoke;
    	}
    div.gridbox_xp table.row20px tr  td{
        height:22px;
        white-space: nowrap;
        padding:1px;
    }
    /* gray skin --------------------------------------------------*/
     
    div.gridbox_gray {
    	border:1px solid gray;
    	background-color:#D4D0C8;
    }
     
    /* mt skin ------------------------------------------------------*/
    div.gridbox_mt{
    	border:1px solid lightgrey;
    }
    div.gridbox_mt table.hdr td {
    	color:#616161;
    	border:0px;
    	border-bottom: 1px solid lightgrey;
    	border-left: 1px solid lightgrey
    	text-align: center;
    	margin:0px;
    	background-image:url('../imgs/header_bg.gif');
    	padding: 0px 0px 0px 0px;
    	-moz-user-select:none;
    	overflow:hidden;
    	}
    div.gridbox_mt table.hdr td div.hdrcell{
    	height:16px;
    	white-space : nowrap;
    	font-family:Verdana;
    	font-size:12px;
    }
    div.gridbox_mt table.obj td {
    	border:0px;
    	border-bottom: 1px solid lightgrey;
    	border-right: 0px solid lightgrey;
    	font-family:Verdana;
    	font-size:12px;
        -moz-user-select:none;
        overflow:hidden;
        padding-top:0px;
        padding-bottom:0px;
    	vertical-align:middle;
    	}
    div.gridbox_mt table.obj tr.rowselected td{
    	background-color:#D6D3FA;
    	color:black;
    	}
    div.gridbox_mt table.obj tr.rowselected td.cellselected, div.gridbox table.obj td.cellselected {
    	background-color:#D6D3FA;
    	}
    div.gridbox_mt table.row20px tr  td{
        height:22px;
        white-space: nowrap;
        padding:1px;
    }
     
    /*------------------------------------------------------------*/
     
     
    div.gridbox div.ftr{
      position:absolute;
      left:0px;
      bottom:1px;
      width:100%;
      padding-right:20px;
      overflow:hidden;
    }
     
    div.gridbox div.ftr td {
    		height:20px;
    		padding:0px;
    		padding-left:10px;
    		padding-right:5px;
    		border-top:1px solid gray;
    		border-right:1px solid gray;
    		background-color:#ffffcc;
    		font-style : italic;
    		font-family:arial;
    		font-size:12px;
    	}
     
    div.gridbox table.hdr td.columnTargetR div.hdrcell{
    	border-right:3px double #FF6600;
    	border-left:3px solid #D4D0C8;
    }
     
    div.gridbox table.hdr td.columnTargetL div.hdrcell{
    	border-right:3px solid #D4D0C8;
    	border-left:3px double #FF6600;
    }
     
    .dhx_dragColDiv{
    	font-family:Arial;
    	font-size:12px;
    	background-color:#D4D0C8;
    	border: 1px solid;
    	border-color : white Gray Gray white;
    	text-align: center;
    	margin:0px;
    	padding:5px 20px 5px 20px ;
    	font-weight:normal;
    	filter:alpha(opacity:75);
    	-moz-opacity:0.75;
    	opacity:0.75;
    }

  2. #2
    BnA
    BnA est déconnecté
    Membre éclairé Avatar de BnA
    Inscrit en
    Mars 2006
    Messages
    559
    Détails du profil
    Informations personnelles :
    Âge : 41

    Informations forums :
    Inscription : Mars 2006
    Messages : 559
    Par défaut
    Salut!

    Essaie avec ceci:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    word-wrap: break-word;
    à l'endroit incriminé.

  3. #3
    Membre confirmé
    Profil pro
    Inscrit en
    Novembre 2007
    Messages
    74
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Novembre 2007
    Messages : 74
    Par défaut
    Mais je la met où cette ligne de code? Dans le fichier html, dans la feuille de style, dans le test xml,...

    Parce que si c'est dans la feuille de style, je ne vois pas du tout à quel endroit il faut la placer.

  4. #4
    Gunner4902
    Invité(e)
    Par défaut
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    table {
    word-wrap: break-word !important;
    }
    et tu mets ça en début de feuille CSS

    Mais ça ne fonctionne que sous IE…
    sinon tu peux utiliser word-wrap en PHP http://fr3.php.net/wordwrap

  5. #5
    BnA
    BnA est déconnecté
    Membre éclairé Avatar de BnA
    Inscrit en
    Mars 2006
    Messages
    559
    Détails du profil
    Informations personnelles :
    Âge : 41

    Informations forums :
    Inscription : Mars 2006
    Messages : 559
    Par défaut
    Sauf que si tu ajoute !important; ça ne marchera pas sous IE6 car il ne connait pas ce paramètre, et pense alors que la propriété et sa valeur sont fausses.

    Je ne savais pas que word-wrap n'était reconnu que par IE. Tu en es sûr?

  6. #6
    Gunner4902
    Invité(e)
    Par défaut
    C’est pour ça que j’ai mis le !important;

    Pour sa seule compatibilité avec IE, j’en ai discuté il y a quelques mois avec le membres du forum et il semblerait que ça ne soit pas compatible Firefox et Opera (Windows). Après sous Nunux et sous Mac, je n’ai pas testé…

Discussions similaires

  1. [VB.NET] affichage dans un tableau créé dynamiquement
    Par elastoplas dans le forum ASP.NET
    Réponses: 3
    Dernier message: 10/11/2006, 08h25
  2. [MySQL] affichage dans un tableau
    Par apprenti-fab dans le forum PHP & Base de données
    Réponses: 6
    Dernier message: 26/10/2006, 21h38
  3. Affichage dans un tableau ???
    Par yoan_111 dans le forum ASP
    Réponses: 1
    Dernier message: 18/04/2006, 12h22
  4. Problème d'affichage dans un tableau
    Par claralavraie dans le forum ASP
    Réponses: 13
    Dernier message: 21/12/2005, 15h45
  5. [débutant]problèmes d'affichage dans un tableau
    Par Hastur dans le forum Balisage (X)HTML et validation W3C
    Réponses: 12
    Dernier message: 16/08/2005, 12h00

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