Okay
  Public Ticket #2702604
Move filter row
Closed

Comments

  • Chris Johnson started the conversation

    Hi, is there any way to move the filter row which normally displays at the bottom of tables to the top?

    6214543373.png
  • [deleted] replied

    Hi Chris

    Thank you for reaching out to us. 

    You can choose the position of the filters in the general wpDataTables settings like shown on the image below

    5219695973.png

    To display the filters on top of the table please navigate to the Sorting and filtering tab in the table settings and turn on the Show filters in a form above the table as shown on the image below.

    8154061729.png

    I hope this helps, please don't hesitate to contact us if there is anything else we can assist you with.


  • Chris Johnson replied

    Hi Blaženka, thank you so much, I must have skipped over that option several times! :P

    My next question is regarding formatting because the text is hard to read now and I can't find a way to change the colour of the filter row.

    4987918790.png


  • [deleted] replied

    You are most welcomesmile.png

    You can change the color with some custom CSS

    .wpdt-c .wpDataTablesWrapper table.wpDataTable.wpDataTableID-1832 > thead > tr:nth-child(2) > th,
    .wpdt-c .wpDataTablesWrapper table.wpDataTable.wpDataTableID-1832 thead tr:nth-child(2) th,
    .wpdt-c .wpDataTablesWrapper table.wpDataTable.wpDataTableID-1832 thead tr:nth-child(2) th.sorting{ background:white !important; }

    Just change the table ID to your table ID and the background from white to any other color if needed.

    I hope this helps, do let me know if you need any further assistance.

  • Chris Johnson replied

    I'd like this to occur on several tables, will I have to duplicate this code several times for that to happen?

  • [deleted] replied

    Hi Chris

    You can add this code in the wpDataTables main settings for this to be applied to all your tables

    .wpdt-c .wpDataTablesWrapper table.wpDataTable > thead > tr:nth-child(2) > th, 
    .wpdt-c .wpDataTablesWrapper table.wpDataTable thead tr:nth-child(2) th, 
    .wpdt-c .wpDataTablesWrapper table.wpDataTable thead tr:nth-child(2) th.sorting
    
    2900984408.png

    Do let me know if you need any further assistance.


  • Chris Johnson replied

    Hi, this hasn't worked, please see below:

    2146128548.png


    5149294595.png


  • [deleted] replied

    Hi Chris

    The previous code will not work if you have set the header color in the table settings and not in the global wpDataTables settings. So if you want to change the color of the filters below you will have to add this code to each table individually just change the table ID 

    .wpdt-c .wpDataTablesWrapper table.wpDataTable.wpDataTableID-1832 >
     thead > tr:nth-child(2) > th,
    .wpdt-c .wpDataTablesWrapper table.wpDataTable.wpDataTableID-1832
     thead tr:nth-child(2) th,
    .wpdt-c .wpDataTablesWrapper table.wpDataTable.wpDataTableID-1832
     thead tr:nth-child(2) th.sorting{ background:white !important; }

    You can remove the header color from that table and add it with custom CSS to global settings if you wish but then it would be applied to all tables as well.

    I hope this helps, do let me know if you need further assistance.