• Resolved diomtus

    (@diomtus)


    I am trying to set which columns are sortable and which ones are not.  Currently I am using the Custom Commands block for each individual table, but nearly all the tables have the same type of information, so rather than type the same command in the Custom Commands block, I would like to be able to set this in the plugin options tab in the Custom CSS area block so that it sets the same sortable settings to all the tables, but cannot seem to find the proper syntax to do this in the custom css block.  If there is such coding for the custom css, can you please inform me.
    
    this is the line currently in my Custom Commands line:
    "columnDefs": [ { "orderable": false, "targets": [ 7, 8, 9 ] } ]
    
    and the following is what is currently in my Plugin Option Custom CSS block:
    
    
    .tablepress th,
    .tablepress td {
    border: 1px solid #cccccc;
    padding: 3px;
    }
    
    .tablepress tbody td {
    font-family: Arial;
    font-size: 16px;
    line-height: normal;
    }
    
    .tablepress .column-1 {
    width: 1px;
    text-align: right;
    }
    
    .tablepress .column-2,
    .tablepress .column-3,
    .tablepress .column-4,
    .tablepress .column-5,
    .tablepress .column-6,
    .tablepress .column-9,
    .tablepress .column-10 {
    width: 1px;
    text-align: center;
    }
    
    .tablepress .column-7 {
    width: 115px;
    text-align: left;
    }
    
    .tablepress .column-8 {
    width: 330px;
    text-align: left;
    }
    
    .tablepress-id-1 .column-1 {
    text-align: left;
    }
    
    .tablepress-id-1 .column-7,
    .tablepress-id-1 .column-8 {
    width: 1px;
    text-align: center;
    }
    
    Thank You in advance for any information you can provide on this topic.
    
    Blain
    

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author TobiasBg

    (@tobiasbg)

    Hi!

    Thanks for your post and sorry for the trouble!

    Unfortunately, I’ll have to disappoint you here. Setting that “Custom Command” (which is JavaScript code) via the “Custom CSS” text area (which adds CSS code, something that’s independent from JavaScript code) is not possible.

    Best wishes,
    Tobias

    Thread Starter diomtus

    (@diomtus)

    My apologies, I believe I misrepresented my query, or possibly I may be misreading your response. However, if I am reading your response correctly, it wasn’t my intention to place the same code from the Custom Commands into the CSS. What I meant was, is there a CSS code that can be used to set which columns of the table are sortable and which ones are not – or is this something that can only be accomplished with javascript?
    I do know that on each table there is a checkbox to allow users to sort the contents of the table, but this setting turns it completely off or completely on, and I was hoping to find a CSS code to be more specific on which columns were sortable rather than completely on/off for the whole table.

    Blain

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi Blain,

    indeed, setting this can only be achieved with JavaScript code, so there simply is no CSS code that we could use in the “Custom CSS” text field for this. Sorry.

    Regards,
    Tobias

    Thread Starter diomtus

    (@diomtus)

    Although I was hoping a different answer, I do appreciate you taking time to respond to my query. Thank you.

    Blain

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    sure, you are very welcome! Sorry again for not having better news!

    Best wishes,
    Tobias

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘setting sortable columns via custom css in plugin options tab’ is closed to new replies.