• Resolved wor012

    (@wor012)


    Hi.
    Starts to use this plugin. Need help.

    1) Don’t find on forum or help – How to order column by the right side of cell?
    Ex. i need – all numeric columns must be ordered by the right side (on all the tables on site)
    is any setting which affects on all the tables?
    Text columns – by default – by right side, but sometimes by center

    2) i need for numerical colums the devider betwen group of numbers. This is a must!
    ex. i import from clipboard –
    12345678.9
    and on site it must be shown like
    12 345 678.9
    But its a number type, not string and ordering must work properly !! by 12345678.9
    This setting also need to all of my sites tables!!
    Like in google sheets – apply format “### ###0.0” or “### ### ###”

    3) Sometimes (often) i need to highlight the number-type value by the rule:
    all numbers below zero (in concrete columns, not in all number-type columns) must be shown be red color font
    and above zero – by the green color
    How to implement it?

    • This topic was modified 3 years, 12 months ago by wor012.
    • This topic was modified 3 years, 12 months ago by wor012.
    • This topic was modified 3 years, 12 months ago by wor012.
    • This topic was modified 3 years, 12 months ago by wor012.
Viewing 14 replies - 16 through 29 (of 29 total)
  • Thread Starter wor012

    (@wor012)

    10.1) How to use?

    .tablepress {
    	padding: 25px;
    }

    Not working. i try to set to all columns

    • This reply was modified 3 years, 11 months ago by wor012.
    • This reply was modified 3 years, 11 months ago by wor012.
    Plugin Author TobiasBg

    (@tobiasbg)

    Thread Starter wor012

    (@wor012)

    Hi.
    10) Thanks, works

    11) Can you suggest, how to do – when refreshing the page – the table is always ordered by some (often – first) column – but now – by default – all columns have 2 arrows – up and down.
    But i need only up arrow – ex. column is ordered – 1,2,3,4,…max
    How to implement it?

    In order to – user must undarstand straight – the table is ordered by the first column.

    • This reply was modified 3 years, 11 months ago by wor012.
    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    11) You can add this to the “Custom Command” to sort the table when it is opened:

    "order": [ [ 1, "asc" ] ]
    

    (separated from the existing “Custom Commands” with a comma).
    The 1 is the second column (counting starts with 0). And you can choose “asc” to “desc” to change the order.

    Regards,
    Tobias

    Thread Starter wor012

    (@wor012)

    11) Seems not working – i’am trying this

    "columnDefs": [
     { "searchable": false, "orderable": false, "targets": 0 },
     { "order": [ [ 2, "asc" ] ] },
     { className: "col-right", "targets": [2,3,4] },
     { "render": $.fn.dataTable.render.number( ' ', ',', 1 ), "targets":[5] } ,
     { "render": $.fn.dataTable.render.number( ' ', ',', 0 ), "targets":[3,4] } ,
     { "targets":[3,4,5], "createdCell": function(nTd,data,oData,iRow,iCol) { if (data<0) { $(nTd).css('color','red'); } if (data>0) { $(nTd).css('color','green'); } } } ]

    But it’s activated the first (tech) column

    https://h312432.r01host.ru/test1

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    don’t put it inside the "columnDefs" part, but after (or before) it, like

    "order": [ [ 2, "asc" ] ],
    "columnDefs": [
     { "searchable": false, "orderable": false, "targets": 0 },
     { className: "col-right", "targets": [2,3,4] },
     { "render": $.fn.dataTable.render.number( ' ', ',', 1 ), "targets":[5] } ,
     { "render": $.fn.dataTable.render.number( ' ', ',', 0 ), "targets":[3,4] } ,
     { "targets":[3,4,5], "createdCell": function(nTd,data,oData,iRow,iCol) { if (data<0) { $(nTd).css('color','red'); } if (data>0) { $(nTd).css('color','green'); } } } ]

    Regards,
    Tobias

    Thread Starter wor012

    (@wor012)

    Thanks!!!

    11) Works!

    12) How to remove bold font from header of the table?

    • This reply was modified 3 years, 11 months ago by wor012.
    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    12) Please add this to the “Custom CSS” textarea on the “Plugin Options” screen of TablePress:

    .tablepress thead th {
        font-weight: normal;
    }

    Regards,
    Tobias

    Thread Starter wor012

    (@wor012)

    12) Done!

    ??

    13) interesting for me – want to try set hovered color not to header but for all currently ordered column. How i may implement it?

    Hope it’s last question for now.

    • This reply was modified 3 years, 11 months ago by wor012.
    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    13) You could maybe experiment with adding

    "orderClasses": false
    

    to the “Custom Commands” as well, see https://datatables.net/reference/option/orderClasses
    This will then add special CSS classes like sorting_1 to the column, which you can use in CSS styling.

    Regards,
    Tobias

    Thread Starter wor012

    (@wor012)

    13) I cant do this, not working, but – read there – As such, this option is available as a feature switch to allow this feature to be disabled with working with old browsers or large data sets.

    Decide not to use it.

    Instead of this decide simply change some columns background color

    try this from faq, but not working

    .tablepress-id-2 .column-3 td {
    	background-color: #ff0000;
    }

    13.1) How to change the color for column (not header)?
    13.2) And availabe this feature in “Custom command” section?

    • This reply was modified 3 years, 11 months ago by wor012.
    • This reply was modified 3 years, 11 months ago by wor012.
    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    13.1) The CSS structure is a bit different. You will need

    .tablepress-id-2 td.column-3 {
    	background-color: #ff0000 !important;
    }

    13.2) No.

    Regards,
    Tobias

    Thread Starter wor012

    (@wor012)

    Hi. Thanks. Works.
    13) But a little remark – why columns a little bit run into each other?
    see scr https://snipboard.io/zIZB2c.jpg

    There is intersection of columns – 2 header column and 3 data column

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    that’s from the horizontal scrolling or the FixedHeader, as far as I can see. I guess it has rounding errors when doing some calculations with JavaScript. You could maybe try turning off the “Horizontal Scrolling” checkbox and instead use the scroll mode of the TablePress Extension from https://tablepress.org/extensions/responsive-tables/ as it works without JavaScript.

    Regards,
    Tobias

Viewing 14 replies - 16 through 29 (of 29 total)
  • The topic ‘How to set some settings: order, highlight zeroes, separator’ is closed to new replies.