Okay
  Public Ticket #3621154
Remove column header
Closed

Comments

  • Matthieu started the conversation

    Hi, I would like to remove the header on some tables I have but not all of them.

    I found that information :

    This will be affected on all tables, but if you want just for specific one then insert this code on the page where is that table between the style tag (<style>Code here</style>

    <style>
    .wpdt-c .wpDataTablesWrapper table.wpDataTable thead {
    display: none !important;
    }
    </style>

    But I don't know where can I find the page code ? I'm using elementor Pro.

    Can you help me ? 

    Thanks a lot

  •  1,846
    Miloš replied

    Hello,

    I will advise you on different ways how you can hide Column Headers.

    We will start from the easiest way, to just hide all headers of a specific Table on a WP Page, then we will go over some 'more advanced' ways how you can choose to hide just specific Headers on a Table, etc.


    1. If you wish to hide all Headers on a specific Table, and if this table will be on its own on the WP Page, then the CSS you already found does the trick.

    Use this custom CSS code :

    .wpdt-c .wpDataTablesWrapper table.wpDataTable thead {
    display: none !important;
    }
    

    Custom code needs to be applied to the page where the booking form is. Depending on what you're using (Gutenberg blocks, or some page builder), adding the CSS or JS can be done in a few different ways. 

    If you need help with adding custom CSS to the page, please take a look at this article.


    Here is my example, I will just go to my Page with the Table, then go to the Theme's Customize section ( i use Astra Theme for this example) and here I an add "Additional CSS".

    7940995208.png
    9809433009.png

    Then publish the change, and that's it.

    -

    2. If you wish to 'target' a specific Table ID only, do this :

    .wpdt-c .wpDataTablesWrapper table.wpDataTableID-1 thead {
    display: none !important;
    }

    Just change the 1 to your Table ID.


    3. This is a workaround if you wish to try just hiding some specific Column Headers, while leaving others visible :

    Add a custom CSS class in the Column's Display settings, for each column we wish the header to "hide".

    I will name the class "hideHeader" , but you can name it anything you wish.

    2631029869.png

    Then add this CSS into your custom CSS tab:

    th.wdtheader.hideHeader { 
       display: none;
    }
    

    So now, any Column that has that class is going to hide it's Header.

    8717034849.png

    Let me know how it goes and if you have any questions.smile.png

    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables