• Resolved jmceisam

    (@jmceisam)


    Hi there,

    Thank you for your amazing plug-in.

    I have troubles in table display, to resolve it I would need the css code to make 3 colums of 33% width but I can’t find out how to write the right code. Could you help please?

    By the way, I would like to custom the colours. How to:
    – Header line: Font in white, background in #63bdec
    – rows: no need to change
    – hover on rows: font in white, background in #5f428d, links in white

    Many thanks in advance

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    Please see the TablePress FAQ page at https://tablepress.org/faq/ for suggestions on the CSS code for column width and colors.

    Regards,
    Tobias

    Thread Starter jmceisam

    (@jmceisam)

    Great, thanks for all, all work fine! Sorry I didn’t check out the FAQ before.

    One more question: I have a tree columns table (name, infos, team), and I just want two of them to be sorted (name and team), how can I do to avoid one column to be sorted (the info column)?

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    good to hear that this helped!

    Turning off sorting for that column is possible by adding this to the “Custom Commands” text field on the “Edit” screen of the table:

    "columnDefs": [ { "ordering": false, "targets": [ 1 ] } ]
    

    This will turn off sorting for the second column (counting the columns starts with 0).

    Regards,
    Tobias

    Thread Starter jmceisam

    (@jmceisam)

    Sorry to anoy you again, I do not see where this Custom Commands text filed is as it is in French for me, is that the text field under “Javascript DataTables library content” ?

    And then, relating to this post : https://ww.wp.xz.cn/support/topic/multiple-custom-commands/
    If I want to have the first column to be sorted by default in ascending, what should I write?

    Sorry if I have too much help 🙁 I wasn’t supposed to create this…

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    yes, it’s the text field in the “Javascript DataTables library content” section.

    To have the first column sorted automatically, please extend the command like this:

    "columnDefs": [ { "ordering": false, "targets": [ 1 ] } ], "order": [ [ 0, "asc" ] ]
    

    Regards,
    Tobias

    Thread Starter jmceisam

    (@jmceisam)

    Spectacular!

    The false ordering command doesn’t work, but the ascending does.

    Don’t worry about the false ordering, you helped me so much at this point.

    Last question: is that possible to change the background color of the first cell of the selected column?

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    Can you please post a link to the page with the table where this problem happens, so that I can take a direct look? Thanks!

    As for the colors: Please see the second part of code from https://tablepress.org/faq/change-background-color-table-head-row/

    Regards,
    Tobias

    Thread Starter jmceisam

    (@jmceisam)

    Hi,

    Thank you very much, again. The hover color when sorting CSS code is working absolutly fine.
    At this time, the fact that the second column sorting is not turned off is not a problem, but more like an attention to detail. The website is not public yet, but I will notice you it will be.

    Thank you again! I’ll let you know 🙂

    Have a good day and take care,

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    ah, I made a small mistake.

    "ordering": false
    

    should be

    "orderable": false
    

    Can you please try again with that?

    Regards,
    Tobias

    Thread Starter jmceisam

    (@jmceisam)

    Yes ! It works !

    Thanks a lot Tobias !!!

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    no problem, you are very welcome! 🙂 Good to hear that this helped!

    Best wishes,
    Tobias

    P.S.: In case you haven’t, please rate TablePress here in the plugin directory. Thanks!

Viewing 11 replies - 1 through 11 (of 11 total)

The topic ‘Automatic column width CSS code?’ is closed to new replies.