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 :

Fixer strictement la taille d'une ligne dans un tableau


Sujet :

Tableau en CSS

  1. #1
    Membre expérimenté
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Novembre 2015
    Messages
    644
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 30
    Localisation : France, Loire Atlantique (Pays de la Loire)

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Novembre 2015
    Messages : 644
    Points : 1 509
    Points
    1 509
    Par défaut Fixer strictement la taille d'une ligne dans un tableau
    Bonjour à tous !

    J'utilise le plugin Jquery Datatables pour gérer un tableau de manière responsive et plus ou moins esthétique (les goûts et les couleurs... n'en discutons pas !)

    Tout se passe bien, sauf pour la taille des lignes. Lorsque le texte est trop grand, la hauteur de la ligne est tout aussi grande. Malgré mes essais, overflow:hidden, max-height:50px; (par exemple), l'inspecteur de Mozilla me donne une taille de 1954px (pour un texte assez grand) qui, d'après mes calculs, correspond au nombre de ligne * la propriété line-height + la propriété height que je lui donne... a quelque chose près, ça correspond.

    Voici donc mon code:


    Le tableau version HTML:
    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
    <div id="action_datatable" class="panel-action-creation tab-pane fade"> 
    				<table id="example" class="dt-responsive nowrap" cellspacing="0" width="100%">
    					<thead>
    						<tr>
    							<th></th>
    							<th>Nom de l'action</th>
    							<th>Type de l'action</th>
    							<th>Destinataire</th>
    							<th>Détails</th>
    							<th>Date prévu</th>
    						</tr>
    					</thead>
    					<tfoot>
    						<tr>
    							<th></th>
    							<th>Nom de l'action</th>
    							<th>Type de l'action</th>
    							<th>Destinataire</th>
    							<th>Détails</th>
    							<th>Date prévu</th>
    						</tr>
    					</tfoot>
    				</table>
    			</div>

    Le css associé :

    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
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
    420
    421
    422
    423
    424
    425
    426
    427
    428
    429
    430
    431
    432
    433
    434
    435
    436
    437
    438
    439
    440
    441
    442
    443
    444
    445
    446
    447
    448
    449
    450
    451
    452
    453
    454
    455
    456
    457
    458
    459
    460
    461
    462
    463
    464
    465
    466
    467
    468
    469
    470
    471
    472
    473
    474
    475
    476
    477
    478
    479
    480
    481
    482
    483
    484
    485
    486
    487
    488
    489
    490
    491
    492
    493
    494
    495
    496
    497
    498
    499
    500
    501
    502
    503
    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    527
    528
    529
    530
    531
    532
    533
    534
    535
    536
    537
    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    565
    566
    567
    568
    569
    570
    571
    572
    573
    574
    575
    576
    577
    578
    579
    580
    581
    582
    583
    584
    585
    586
    587
    588
    589
    590
    591
    592
    593
    594
    595
    596
    597
    598
    599
    600
    601
    602
    603
    604
    605
    606
    607
    608
    609
    610
    611
    612
    613
    614
    615
    616
    617
    618
    619
    620
    621
    622
    623
    624
    625
    626
    627
    628
    629
    630
    631
    632
    633
    634
    635
    636
    637
    638
    639
    640
    641
    642
    643
    644
    645
    /*
     * Table styles
     */
    table.dataTable {
      width: 100%;
      margin: 0 auto;
      clear: both;
      border-collapse: separate;
      border-spacing: 0;
      /*
       * Header and footer styles
       */
      /*
       * Body styles
       */
    }
    table.dataTable thead th,
    table.dataTable tfoot th {
      font-weight: bold;
    }
    table.dataTable thead th,
    table.dataTable thead td {
      padding: 10px 18px;
      border-bottom: 1px solid #111;
    }
    table.dataTable thead th:active,
    table.dataTable thead td:active {
      outline: none;
    }
    table.dataTable tfoot th,
    table.dataTable tfoot td {
      padding: 10px 18px 6px 18px;
      border-top: 1px solid #111;
    }
    table.dataTable thead .sorting,
    table.dataTable thead .sorting_asc,
    table.dataTable thead .sorting_desc {
      cursor: pointer;
      *cursor: hand;
    }
    table.dataTable thead .sorting,
    table.dataTable thead .sorting_asc,
    table.dataTable thead .sorting_desc,
    table.dataTable thead .sorting_asc_disabled,
    table.dataTable thead .sorting_desc_disabled {
      background-repeat: no-repeat;
      background-position: center right;
    }
    table.dataTable thead .sorting {
      background-image: url("DataTables-1.10.11/images/sort_both.png");
    }
    table.dataTable thead .sorting_asc {
      background-image: url("DataTables-1.10.11/images/sort_asc.png");
    }
    table.dataTable thead .sorting_desc {
      background-image: url("DataTables-1.10.11/images/sort_desc.png");
    }
    table.dataTable thead .sorting_asc_disabled {
      background-image: url("DataTables-1.10.11/images/sort_asc_disabled.png");
    }
    table.dataTable thead .sorting_desc_disabled {
      background-image: url("DataTables-1.10.11/images/sort_desc_disabled.png");
    }
    table.dataTable tbody tr {
      background-color: #ffffff;
    }
    table.dataTable tbody tr.selected {
      background-color: #B0BED9;
    }
    table.dataTable tbody th,
    table.dataTable tbody td {
      padding: 8px 10px;
    }
    table.dataTable.row-border tbody th, table.dataTable.row-border tbody td, table.dataTable.display tbody th, table.dataTable.display tbody td {
      border-top: 1px solid #ddd;
    }
    table.dataTable.row-border tbody tr:first-child th,
    table.dataTable.row-border tbody tr:first-child td, table.dataTable.display tbody tr:first-child th,
    table.dataTable.display tbody tr:first-child td {
      border-top: none;
    }
    table.dataTable.cell-border tbody th, table.dataTable.cell-border tbody td {
      border-top: 1px solid #ddd;
      border-right: 1px solid #ddd;
    }
    table.dataTable.cell-border tbody tr th:first-child,
    table.dataTable.cell-border tbody tr td:first-child {
      border-left: 1px solid #ddd;
    }
    table.dataTable.cell-border tbody tr:first-child th,
    table.dataTable.cell-border tbody tr:first-child td {
      border-top: none;
    }
    table.dataTable.stripe tbody tr.odd, table.dataTable.display tbody tr.odd {
      background-color: #f9f9f9;
    }
    table.dataTable.stripe tbody tr.odd.selected, table.dataTable.display tbody tr.odd.selected {
      background-color: #acbad4;
    }
    table.dataTable.hover tbody tr:hover, table.dataTable.display tbody tr:hover {
      background-color: #f6f6f6;
    }
    table.dataTable.hover tbody tr:hover.selected, table.dataTable.display tbody tr:hover.selected {
      background-color: #aab7d1;
    }
    table.dataTable.order-column tbody tr > .sorting_1,
    table.dataTable.order-column tbody tr > .sorting_2,
    table.dataTable.order-column tbody tr > .sorting_3, table.dataTable.display tbody tr > .sorting_1,
    table.dataTable.display tbody tr > .sorting_2,
    table.dataTable.display tbody tr > .sorting_3 {
      background-color: #fafafa;
    }
    table.dataTable.order-column tbody tr.selected > .sorting_1,
    table.dataTable.order-column tbody tr.selected > .sorting_2,
    table.dataTable.order-column tbody tr.selected > .sorting_3, table.dataTable.display tbody tr.selected > .sorting_1,
    table.dataTable.display tbody tr.selected > .sorting_2,
    table.dataTable.display tbody tr.selected > .sorting_3 {
      background-color: #acbad5;
    }
    table.dataTable.display tbody tr.odd > .sorting_1, table.dataTable.order-column.stripe tbody tr.odd > .sorting_1 {
      background-color: #f1f1f1;
    }
    table.dataTable.display tbody tr.odd > .sorting_2, table.dataTable.order-column.stripe tbody tr.odd > .sorting_2 {
      background-color: #f3f3f3;
    }
    table.dataTable.display tbody tr.odd > .sorting_3, table.dataTable.order-column.stripe tbody tr.odd > .sorting_3 {
      background-color: whitesmoke;
    }
    table.dataTable.display tbody tr.odd.selected > .sorting_1, table.dataTable.order-column.stripe tbody tr.odd.selected > .sorting_1 {
      background-color: #a6b4cd;
    }
    table.dataTable.display tbody tr.odd.selected > .sorting_2, table.dataTable.order-column.stripe tbody tr.odd.selected > .sorting_2 {
      background-color: #a8b5cf;
    }
    table.dataTable.display tbody tr.odd.selected > .sorting_3, table.dataTable.order-column.stripe tbody tr.odd.selected > .sorting_3 {
      background-color: #a9b7d1;
    }
    table.dataTable.display tbody tr.even > .sorting_1, table.dataTable.order-column.stripe tbody tr.even > .sorting_1 {
      background-color: #fafafa;
    }
    table.dataTable.display tbody tr.even > .sorting_2, table.dataTable.order-column.stripe tbody tr.even > .sorting_2 {
      background-color: #fcfcfc;
    }
    table.dataTable.display tbody tr.even > .sorting_3, table.dataTable.order-column.stripe tbody tr.even > .sorting_3 {
      background-color: #fefefe;
    }
    table.dataTable.display tbody tr.even.selected > .sorting_1, table.dataTable.order-column.stripe tbody tr.even.selected > .sorting_1 {
      background-color: #acbad5;
    }
    table.dataTable.display tbody tr.even.selected > .sorting_2, table.dataTable.order-column.stripe tbody tr.even.selected > .sorting_2 {
      background-color: #aebcd6;
    }
    table.dataTable.display tbody tr.even.selected > .sorting_3, table.dataTable.order-column.stripe tbody tr.even.selected > .sorting_3 {
      background-color: #afbdd8;
    }
    table.dataTable.display tbody tr:hover > .sorting_1, table.dataTable.order-column.hover tbody tr:hover > .sorting_1 {
      background-color: #eaeaea;
    }
    table.dataTable.display tbody tr:hover > .sorting_2, table.dataTable.order-column.hover tbody tr:hover > .sorting_2 {
      background-color: #ececec;
    }
    table.dataTable.display tbody tr:hover > .sorting_3, table.dataTable.order-column.hover tbody tr:hover > .sorting_3 {
      background-color: #efefef;
    }
    table.dataTable.display tbody tr:hover.selected > .sorting_1, table.dataTable.order-column.hover tbody tr:hover.selected > .sorting_1 {
      background-color: #a2aec7;
    }
    table.dataTable.display tbody tr:hover.selected > .sorting_2, table.dataTable.order-column.hover tbody tr:hover.selected > .sorting_2 {
      background-color: #a3b0c9;
    }
    table.dataTable.display tbody tr:hover.selected > .sorting_3, table.dataTable.order-column.hover tbody tr:hover.selected > .sorting_3 {
      background-color: #a5b2cb;
    }
    table.dataTable.no-footer {
      border-bottom: 1px solid #111;
    }
    table.dataTable.nowrap th, table.dataTable.nowrap td {
      white-space: nowrap;
    }
    table.dataTable.compact thead th,
    table.dataTable.compact thead td {
      padding: 4px 17px 4px 4px;
    }
    table.dataTable.compact tfoot th,
    table.dataTable.compact tfoot td {
      padding: 4px;
    }
    table.dataTable.compact tbody th,
    table.dataTable.compact tbody td {
      padding: 4px;
    }
    table.dataTable th.dt-left,
    table.dataTable td.dt-left {
      text-align: left;
    }
    table.dataTable th.dt-center,
    table.dataTable td.dt-center,
    table.dataTable td.dataTables_empty {
      text-align: center;
    }
    table.dataTable th.dt-right,
    table.dataTable td.dt-right {
      text-align: right;
    }
    table.dataTable th.dt-justify,
    table.dataTable td.dt-justify {
      text-align: justify;
    }
    table.dataTable th.dt-nowrap,
    table.dataTable td.dt-nowrap {
      white-space: nowrap;
    }
    table.dataTable thead th.dt-head-left,
    table.dataTable thead td.dt-head-left,
    table.dataTable tfoot th.dt-head-left,
    table.dataTable tfoot td.dt-head-left {
      text-align: left;
    }
    table.dataTable thead th.dt-head-center,
    table.dataTable thead td.dt-head-center,
    table.dataTable tfoot th.dt-head-center,
    table.dataTable tfoot td.dt-head-center {
      text-align: center;
    }
    table.dataTable thead th.dt-head-right,
    table.dataTable thead td.dt-head-right,
    table.dataTable tfoot th.dt-head-right,
    table.dataTable tfoot td.dt-head-right {
      text-align: right;
    }
    table.dataTable thead th.dt-head-justify,
    table.dataTable thead td.dt-head-justify,
    table.dataTable tfoot th.dt-head-justify,
    table.dataTable tfoot td.dt-head-justify {
      text-align: justify;
    }
    table.dataTable thead th.dt-head-nowrap,
    table.dataTable thead td.dt-head-nowrap,
    table.dataTable tfoot th.dt-head-nowrap,
    table.dataTable tfoot td.dt-head-nowrap {
      white-space: nowrap;
    }
    table.dataTable tbody th.dt-body-left,
    table.dataTable tbody td.dt-body-left {
      text-align: left;
    }
    table.dataTable tbody th.dt-body-center,
    table.dataTable tbody td.dt-body-center {
      text-align: center;
    }
    table.dataTable tbody th.dt-body-right,
    table.dataTable tbody td.dt-body-right {
      text-align: right;
    }
    table.dataTable tbody th.dt-body-justify,
    table.dataTable tbody td.dt-body-justify {
      text-align: justify;
    }
    table.dataTable tbody th.dt-body-nowrap,
    table.dataTable tbody td.dt-body-nowrap {
      white-space: nowrap;
    }
     
    table.dataTable,
    table.dataTable th,
    table.dataTable td {
      -webkit-box-sizing: content-box;
      -moz-box-sizing: content-box;
     /* box-sizing: content-box;*/
    }
     
    /*
     * Control feature layout
     */
    .dataTables_wrapper {
      position: relative;
      clear: both;
      *zoom: 1;
      zoom: 1;
    }
    .dataTables_wrapper .dataTables_length {
      float: left;
    }
    .dataTables_wrapper .dataTables_filter {
      float: right;
      text-align: right;
    }
    .dataTables_wrapper .dataTables_filter input {
      margin-left: 0.5em;
    }
    .dataTables_wrapper .dataTables_info {
      clear: both;
      float: left;
      padding-top: 0.755em;
    }
    .dataTables_wrapper .dataTables_paginate {
      float: right;
      text-align: right;
      padding-top: 0.25em;
    }
    .dataTables_wrapper .dataTables_paginate .paginate_button {
      box-sizing: border-box;
      display: inline-block;
      min-width: 1.5em;
      padding: 0.5em 1em;
      margin-left: 2px;
      text-align: center;
      text-decoration: none !important;
      cursor: pointer;
      *cursor: hand;
      color: #333 !important;
      border: 1px solid transparent;
      border-radius: 2px;
    }
    .dataTables_wrapper .dataTables_paginate .paginate_button.current, .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
      color: #333 !important;
      border: 1px solid #979797;
      background-color: white;
      background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, white), color-stop(100%, #dcdcdc));
      /* Chrome,Safari4+ */
      background: -webkit-linear-gradient(top, white 0%, #dcdcdc 100%);
      /* Chrome10+,Safari5.1+ */
      background: -moz-linear-gradient(top, white 0%, #dcdcdc 100%);
      /* FF3.6+ */
      background: -ms-linear-gradient(top, white 0%, #dcdcdc 100%);
      /* IE10+ */
      background: -o-linear-gradient(top, white 0%, #dcdcdc 100%);
      /* Opera 11.10+ */
      background: linear-gradient(to bottom, white 0%, #dcdcdc 100%);
      /* W3C */
    }
    .dataTables_wrapper .dataTables_paginate .paginate_button.disabled, .dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover, .dataTables_wrapper .dataTables_paginate .paginate_button.disabled:active {
      cursor: default;
      color: #666 !important;
      border: 1px solid transparent;
      background: transparent;
      box-shadow: none;
    }
    .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
      color: white !important;
      border: 1px solid #111;
      background-color: #585858;
      background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #585858), color-stop(100%, #111));
      /* Chrome,Safari4+ */
      background: -webkit-linear-gradient(top, #585858 0%, #111 100%);
      /* Chrome10+,Safari5.1+ */
      background: -moz-linear-gradient(top, #585858 0%, #111 100%);
      /* FF3.6+ */
      background: -ms-linear-gradient(top, #585858 0%, #111 100%);
      /* IE10+ */
      background: -o-linear-gradient(top, #585858 0%, #111 100%);
      /* Opera 11.10+ */
      background: linear-gradient(to bottom, #585858 0%, #111 100%);
      /* W3C */
    }
    .dataTables_wrapper .dataTables_paginate .paginate_button:active {
      outline: none;
      background-color: #2b2b2b;
      background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #2b2b2b), color-stop(100%, #0c0c0c));
      /* Chrome,Safari4+ */
      background: -webkit-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);
      /* Chrome10+,Safari5.1+ */
      background: -moz-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);
      /* FF3.6+ */
      background: -ms-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);
      /* IE10+ */
      background: -o-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);
      /* Opera 11.10+ */
      background: linear-gradient(to bottom, #2b2b2b 0%, #0c0c0c 100%);
      /* W3C */
      box-shadow: inset 0 0 3px #111;
    }
    .dataTables_wrapper .dataTables_paginate .ellipsis {
      padding: 0 1em;
    }
    .dataTables_wrapper .dataTables_processing {
      position: absolute;
      top: 50%;
      left: 50%;
      width: 100%;
      height: 40px;
      margin-left: -50%;
      margin-top: -25px;
      padding-top: 20px;
      text-align: center;
      font-size: 1.2em;
      background-color: white;
      background: -webkit-gradient(linear, left top, right top, color-stop(0%, rgba(255, 255, 255, 0)), color-stop(25%, rgba(255, 255, 255, 0.9)), color-stop(75%, rgba(255, 255, 255, 0.9)), color-stop(100%, rgba(255, 255, 255, 0)));
      background: -webkit-linear-gradient(left, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.9) 25%, rgba(255, 255, 255, 0.9) 75%, rgba(255, 255, 255, 0) 100%);
      background: -moz-linear-gradient(left, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.9) 25%, rgba(255, 255, 255, 0.9) 75%, rgba(255, 255, 255, 0) 100%);
      background: -ms-linear-gradient(left, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.9) 25%, rgba(255, 255, 255, 0.9) 75%, rgba(255, 255, 255, 0) 100%);
      background: -o-linear-gradient(left, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.9) 25%, rgba(255, 255, 255, 0.9) 75%, rgba(255, 255, 255, 0) 100%);
      background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.9) 25%, rgba(255, 255, 255, 0.9) 75%, rgba(255, 255, 255, 0) 100%);
    }
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_processing,
    .dataTables_wrapper .dataTables_paginate {
      color: #333;
    }
    .dataTables_wrapper .dataTables_scroll {
      clear: both;
    }
    .dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody {
      *margin-top: -1px;
      -webkit-overflow-scrolling: touch;
    }
    .dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody th, .dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody td {
      vertical-align: middle;
    }
    .dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody th > div.dataTables_sizing,
    .dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody td > div.dataTables_sizing {
      height: 0;
      overflow: hidden;
      margin: 0 !important;
      padding: 0 !important;
    }
    .dataTables_wrapper.no-footer .dataTables_scrollBody {
      border-bottom: 1px solid #111;
    }
    .dataTables_wrapper.no-footer div.dataTables_scrollHead table,
    .dataTables_wrapper.no-footer div.dataTables_scrollBody table {
      border-bottom: none;
    }
    .dataTables_wrapper:after {
      visibility: hidden;
      display: block;
      content: "";
      clear: both;
      height: 0;
    }
     
    @media screen and (max-width: 767px) {
      .dataTables_wrapper .dataTables_info,
      .dataTables_wrapper .dataTables_paginate {
        float: none;
        text-align: center;
      }
      .dataTables_wrapper .dataTables_paginate {
        margin-top: 0.5em;
      }
    }
    @media screen and (max-width: 640px) {
      .dataTables_wrapper .dataTables_length,
      .dataTables_wrapper .dataTables_filter {
        float: none;
        text-align: center;
      }
      .dataTables_wrapper .dataTables_filter {
      .dataTables_wrapper .dataTables_filter {
        margin-top: 0.5em;
      }
    }
     
     
    table.dataTable th.focus,
    table.dataTable td.focus {
      outline: 3px solid #3366FF;
      outline-offset: -1px;
    }
     
     
    table.dataTable.dtr-inline.collapsed > tbody > tr > td.child,
    table.dataTable.dtr-inline.collapsed > tbody > tr > th.child,
    table.dataTable.dtr-inline.collapsed > tbody > tr > td.dataTables_empty {
      cursor: default !important;
    }
    table.dataTable.dtr-inline.collapsed > tbody > tr > td.child:before,
    table.dataTable.dtr-inline.collapsed > tbody > tr > th.child:before,
    table.dataTable.dtr-inline.collapsed > tbody > tr > td.dataTables_empty:before {
      display: none !important;
    }
    table.dataTable.dtr-inline.collapsed > tbody > tr > td:first-child,
    table.dataTable.dtr-inline.collapsed > tbody > tr > th:first-child {
      position: relative;
      padding-left: 30px;
      cursor: pointer;
    }
     
    /* ( + ) */
    table.dataTable.dtr-inline.collapsed > tbody > tr > td:first-child:before,
    table.dataTable.dtr-inline.collapsed > tbody > tr > th:first-child:before {
      top: 8px;
      left: 4px;
      height: 16px;
      width: 16px;
      display: block;
      position: absolute;
      color: white;
      border: 2px solid white;
      border-radius: 16px;
      box-shadow: 0 0 3px #444;
      box-sizing: content-box;
      text-align: left;
      font-family: 'Courier New', Courier, monospace;
      text-indent: 4px;
      line-height: 16px;
      content: '+';
      background-color: #31b131;
    }
    table.dataTable.dtr-inline.collapsed > tbody > tr.parent > td:first-child:before,
    table.dataTable.dtr-inline.collapsed > tbody > tr.parent > th:first-child:before {
      content: '-';
      background-color: #d33333;
    }
    table.dataTable.dtr-inline.collapsed > tbody > tr.child td:before {
      display: none;
    }
    table.dataTable.dtr-inline.collapsed.compact > tbody > tr > td:first-child,
    table.dataTable.dtr-inline.collapsed.compact > tbody > tr > th:first-child {
      padding-left: 27px;
    }
    table.dataTable.dtr-inline.collapsed.compact > tbody > tr > td:first-child:before,
    table.dataTable.dtr-inline.collapsed.compact > tbody > tr > th:first-child:before {
      top: 5px;
      left: 4px;
      height: 14px;
      width: 14px;
      border-radius: 14px;
      line-height: 14px;
      text-indent: 3px;
    }
    table.dataTable.dtr-column > tbody > tr > td.control,
    table.dataTable.dtr-column > tbody > tr > th.control {
      position: relative;
      cursor: pointer;
    }
    table.dataTable.dtr-column > tbody > tr > td.control:before,
    table.dataTable.dtr-column > tbody > tr > th.control:before {
      top: 50%;
      left: 50%;
      height: 16px;
      width: 16px;
      margin-top: -10px;
      margin-left: -10px;
      display: block;
      position: absolute;
      color: white;
      border: 2px solid white;
      border-radius: 16px;
      box-shadow: 0 0 3px #444;
      box-sizing: content-box;
      text-align: left;
      font-family: 'Courier New', Courier, monospace;
      text-indent: 4px;
      line-height: 16px;
      content: '+';
      background-color: #31b131;
    }
    table.dataTable.dtr-column > tbody > tr.parent td.control:before,
    table.dataTable.dtr-column > tbody > tr.parent th.control:before {
      content: '-';
      background-color: #d33333;
    }
    table.dataTable > tbody > tr.child {
      padding: 0.5em 1em;
    }
    table.dataTable > tbody > tr.child:hover {
      background: transparent !important;
    }
    table.dataTable > tbody > tr.child ul {
      display: inline-block;
      list-style-type: none;
      margin: 0;
      padding: 0;
    }
    table.dataTable > tbody > tr.child ul li {
      border-bottom: 1px solid #efefef;
      padding: 0.5em 0;
    }
    table.dataTable > tbody > tr.child ul li:first-child {
      padding-top: 0;
    }
    table.dataTable > tbody > tr.child ul li:last-child {
      border-bottom: none;
    }
    table.dataTable > tbody > tr.child span.dtr-title {
      display: inline-block;
      min-width: 75px;
      font-weight: bold;
    }
     
    div.dtr-modal {
      position: fixed;
      box-sizing: border-box;
      top: 0;
      left: 0;
     /* height: 100%; */
      width: 100%;
      z-index: 100;
      padding: 10em 1em;
    }
    div.dtr-modal div.dtr-modal-display {
      position: absolute;
      top: 0;
      left: 0;
      bottom: 0;
      right: 0;
      width: 50%;
      height: 50%;
      overflow: auto;
      margin: auto;
      z-index: 102;
      overflow: auto;
      background-color: #f5f5f7;
      border: 1px solid black;
      border-radius: 0.5em;
      box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
    }
    div.dtr-modal div.dtr-modal-content {
      position: relative;
      padding: 1em;
    }
    div.dtr-modal div.dtr-modal-close {
      position: absolute;
      top: 6px;
      right: 6px;
      width: 22px;
      height: 22px;
      border: 1px solid #eaeaea;
      background-color: #f9f9f9;
      text-align: center;
      border-radius: 3px;
      cursor: pointer;
      z-index: 12;
    }
    div.dtr-modal div.dtr-modal-close:hover {
      background-color: #eaeaea;
    }
    div.dtr-modal div.dtr-modal-background {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      z-index: 101;
      background: rgba(0, 0, 0, 0.6);
    }
     
    @media screen and (max-width: 767px) {
      div.dtr-modal div.dtr-modal-display {
        width: 95%;
      }
    }

    Et ici, le HTML généré par le navigateur (en capture d'écran, j'ai enlevé les informations confidentielles) :
    Nom : f3db8e3ec86e976a6405fe4e9aa0440a.png
Affichages : 696
Taille : 41,6 Ko

    Et une capture d'écran du CSS généré par le navigateur qui concerne le HTML au dessus :
    https://gyazo.com/41e0378b7750d4427c19264d59c3f0c2

    Ce que je cherche à faire :
    Bloquer la hauteur de chaque ligne à une taille fixe. Si le texte est trop long, éventuellement l'afficher au survol de la souris, AU MIEUX. Au pire, rien faire, je m'en chargerais !

    Si quelqu'un à une idée, je me suis probablement emmêle les pinceaux dans les différentes propriétés. ><

    Merci d'avance pour toute aide, piste, blague, tout est bon à prendre !

  2. #2
    Invité
    Invité(e)
    Par défaut
    Bonjour,

    une "capture d'écran" n'a aucun intérêt, surtout si tu veux qu'on puisse TESTER le code, et résoudre le problème.
    Un bour de code fonctionnel serait plus efficace.

    N.B. Où as-tu pêché tes <br></br> ??
    Dernière modification par Invité ; 27/04/2016 à 11h53.

  3. #3
    Modérateur

    Avatar de NoSmoking
    Homme Profil pro
    Inscrit en
    Janvier 2011
    Messages
    17 091
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Isère (Rhône Alpes)

    Informations forums :
    Inscription : Janvier 2011
    Messages : 17 091
    Points : 44 651
    Points
    44 651
    Par défaut
    Bonjour,
    Citation Envoyé par magicarpe44
    Merci d'avance pour toute aide, piste, blague,...
    Citation Envoyé par jreaux62
    N.B. Où as-tu pêché tes <br></br> ??
    Pa surprenant avec le temps qu'il fait <br><br><br><br><br><br><br><br><br><br><br><br><br>


  4. #4
    Membre expérimenté
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Novembre 2015
    Messages
    644
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 30
    Localisation : France, Loire Atlantique (Pays de la Loire)

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Novembre 2015
    Messages : 644
    Points : 1 509
    Points
    1 509
    Par défaut
    Bonjour à vous deux !

    Mon beau Jreaux (enterrons la hache de guerre, vaut mieux prendre la vie côté plaisir !), merci encore pour ton intervention.

    Je suis bien conscient qu'une capture d'écran ne pèse pas bien lourd... Mais si je l'ai fais, il y à une raison *-*

    Pourquoi autant de <br/>? Tout simplement parce que mon tableau est remplit via une requête, formatée en JSON. Les <br/> incessant relèvent donc des messages que je récupère (qui sont généralement issue de conversation qui se transfère d'une à l'autre et où, après formatage de celles-ci, me donne cette syntaxe là.

    Je prends bien évidemment les liens vers tous les tutos voyons. Mais après avoir testé pas mal de choses, je sèche..

    Cordialement,

  5. #5
    Invité
    Invité(e)
    Par défaut
    Bonjour,

    1/

    2/ la syntaxe correcte est : <br/>.

    3/ J'ai fait dans cette discussion une réponse qui pourrait t'intéresser.

    Appliquer à ton cas : mettre le texte trop long dans un <div>, à hauteur fixée, comme dans ma démo : http://codepen.io/jreaux62/pen/WwgGWE
    Code html : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    <td>
       <div class="resume">
         bla bla
         <br/>
         bla bla
         <br/>
         bla bla 
       </div>
    </td>
    Code css : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    .resume {
      width: 400px;
      height: 195px; /* on fixe les dimensions */
      overflow: hidden; /* on masque ce qui dépasse */
      text-overflow: ellipsis;
    }
    + le JavaScript qui va bien pou afficher/masquer.

    4/ Ou, plus simplement, avec affichage d'une scrollbar (simple, mais moins ergonomique sur smartphone) :
    Code css : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    .resume {
      width: 400px;
      height: 195px;
      overflow: auto; /* scrollbar automatique si texte trop long */
    }

  6. #6
    Membre expérimenté
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Novembre 2015
    Messages
    644
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 30
    Localisation : France, Loire Atlantique (Pays de la Loire)

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Novembre 2015
    Messages : 644
    Points : 1 509
    Points
    1 509
    Par défaut
    :tchin:

    Le problème étant, comme mon HTML du premier post te le montre, tout est généré automatiquement dans des <td>.

    Je me suis alors demandé, il est donc impossible de bloquer la taille d'une cellule à une hauteur fixe?

  7. #7
    Invité
    Invité(e)
    Par défaut
    Citation Envoyé par magicarpe44 Voir le message
    ...tout est généré automatiquement dans des <td>...
    • Et tu n'as pas accès au code ?
    • Tu ne peux pas ajouter ces 2 balises <div> et </div> ?

  8. #8
    Membre expérimenté
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Novembre 2015
    Messages
    644
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 30
    Localisation : France, Loire Atlantique (Pays de la Loire)

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Novembre 2015
    Messages : 644
    Points : 1 509
    Points
    1 509
    Par défaut
    Je fais mes tests et je reviens vers toi !

    Merci beaucoup

  9. #9
    Membre expérimenté
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Novembre 2015
    Messages
    644
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 30
    Localisation : France, Loire Atlantique (Pays de la Loire)

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Novembre 2015
    Messages : 644
    Points : 1 509
    Points
    1 509
    Par défaut
    Suis-je bête. Je ne peux pas placer les divs, il me génère entièrement le <tbody></tbody>.

    Je déclare juste les entêtes de colonnes, le plugin s'occupe du reste... (Bon y à du boulot derrière, mais globalement c'est comme ça que ça se passe)

Discussions similaires

  1. Limiter taille d'une ligne dans un textbox multiligne
    Par luc2verga dans le forum Windows Forms
    Réponses: 4
    Dernier message: 20/11/2009, 07h00
  2. [HTML] Sélectionner une ligne dans un tableau en html
    Par jehlg dans le forum Balisage (X)HTML et validation W3C
    Réponses: 8
    Dernier message: 16/06/2008, 11h55
  3. [VBA-E]insertion automatique d'une ligne dans un tableau
    Par janus82 dans le forum Macros et VBA Excel
    Réponses: 7
    Dernier message: 06/04/2006, 15h42
  4. selection d'une ligne dans un tableau en html
    Par jehlg dans le forum Général JavaScript
    Réponses: 1
    Dernier message: 08/02/2006, 23h08
  5. probleme bizarre de hauteur auto d'une ligne dans un tableau
    Par zax-tfh dans le forum Balisage (X)HTML et validation W3C
    Réponses: 5
    Dernier message: 17/01/2005, 23h34

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