Problème d'alignement avec colonnes figées

Problème d'alignement avec colonnes figées

chipster91chipster91 Posts: 9Questions: 3Answers: 0
edited June 2018 in Free community support

Bonjour,
J'utilise Datatable 1.10.18 en mode server-side, et des inputs de recherche en pied de page.
Lorsque je fixe mes colonnes à gauche (2 car la première est cachée), j'ai un décalage de ligne à l'affichage et mes commentaire de cellule (title) n'apparaissent pas sur les colonnes figées. Dès que je click sur une cellule, tout revient dans l'ordre.
Merci de m'aider à trouver une solution
Exemple car je travail en local:
http://live.datatables.net/dunahohu/1/edit
Cordialement,

Answers

  • allanallan Posts: 63,455Questions: 1Answers: 10,465 Site admin

    Its being caused by the defaultContent that includes the img elements. If you remove that, it works okay.

    What I think is happening is that once the images load (or fail to load in this case) the row height changes, causing the content rows to expand or contract as required.

    You'd either need to call fixedColumns().relayout() when the images are loading, or use CSS row sizing - e.g. tr { height: 50px; }.

    Regards,
    Allan

  • chipster91chipster91 Posts: 9Questions: 3Answers: 0
    edited July 2018

    Hello,
    Thank for answer and sorry english is not my language!
    The CSS solution work for alignement, but my red class on fixedColumn appears only after a TD click. I don't understand why! How can i use the fixedColumns().relayout() API? I remove img on my example, and same result:
    http://live.datatables.net/dunahohu/4/edit

    Regards

  • allanallan Posts: 63,455Questions: 1Answers: 10,465 Site admin

    I don't actually see is what is making it red at all? Where is that code?

    Allan

  • chipster91chipster91 Posts: 9Questions: 3Answers: 0
    edited July 2018

    In javascript, the line:
    $( "td:eq( 1 )" ).css( "color", "red" ); make 1st line, 2nd column in red.
    The result is not visible on the load, but only after click on table.
    Script $( "td:eq(3 )" ).css( "color", "red" ); add class on non fixedColumn work well!
    I would like see the class effect on fixedColumn at page load.
    http://live.datatables.net/dunahohu/5/edit
    Thanks

This discussion has been closed.