Datatable 1.12.1 : TR Font size on serverside mode ?

Datatable 1.12.1 : TR Font size on serverside mode ?

CouinCouin Posts: 12Questions: 4Answers: 0

Hi,

Just a minor question, I do'nt find the info on the web :(
I change a datatable not serverside mode to serverside mode to reduce loading times (3000 lines).

I took a previous servermode datatable I created, but I need to customise result lines a little.

About customization, I already mad td with nowrap option actived , with this code :

columnDefs: [
{ className: "dt-body-nowrap", "targets": [ 0, 1, 2, 3, 4, 5, 6 ] }
],

But I would change the TR font size.
I don't find the syntax :(

Thanks for help :)
Couin

Answers

  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin

    Assuming you have one of our stylesheets listed, that should cause the text in the take body to not wrap. If it still is, please link to a test case showing the issue so I can look into it.

    Allan

  • CouinCouin Posts: 12Questions: 4Answers: 0

    Hi Allan,

    I created 2 examples , one in "local" the other in "serverside mode".

    For local, I limited the datas to 1000 entries on 26000.

    On server side, the problem is not the warp but the font size that I would set to 70% for result rows like table head row. Like in local mode.

    You could see here :
    https://jinglepalettereloaded.com/testdt/

    Thanks :)

  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin

    Oh I see - you want to know how to add style="font-size:70%" as an attribute to the tr elements in the table?

    You could use createdRow to do that.

    But can't you just add it to your page's CSS?

    tr {
      font-size: 70%;
    }
    

    Allan

  • CouinCouin Posts: 12Questions: 4Answers: 0
    edited May 2023

    Hi Allan,

    Yes, I manually set the row font size in local mode.

    Thanks for help, both solutions

    tr {
    font-size: 70%;
    }

    and

    "createdRow": function( row, data, dataIndex ) {
    $(row).css("font-size", "70%");
    }

    are OK :)

    To keep the example, I kept the createdRow solution :)

    See ya !

Sign In or Register to comment.