Okay
  Public Ticket #3623852
Update table header
Closed

Comments

  • Mark started the conversation

    There are multiple instances on the same table on the page.  Vars are used to display different records.   I need different  headers on different tables.

    The following code does not change the table header.  What am I missing?

    document.addEventListener("DOMContentLoaded", function() {
        // Your function to alter HTML goes here
        var table = document.getElementById('table_2');

       // Get the header of the first column
    var firstColumnHeader = table.querySelector('th:first-child');
    firstColumnHeader.textContent = 'New';

    })


  • Mark replied

    The code updates the header works when triggered by a btn click, but not when the page is being rendered

  •  1,877
    Miloš replied

    Hi Mark,

    Sorry to disappoint you, but at this time, we don't have any built-in solution to achieve this

    You can suggest it to our developers, though - they will do their best to make a solution in the future.

    Please feel free to search on our suggestions page

     to see if someone may be already suggested this feature. If you can't see it, feel free to add your suggestion there,  and as more people vote, the feature will move higher on the priority list.

    You can certainly follow our changeLog page if you'd like ( it is also available in the plugin dashboard), where we state any changes/new features/bug fixes during updates;

    and our newsletter, so you're informed about new features, bug fixes, freebies, etc.

    -

    If you have coding skills and wish to try to make a custom solution now,

    you can check out our available hooks for Developers on this documentation and see if you can find any hook that might help.

    Please be advised that custom solutions with hooks are not included in our support.

    You can also research resources such as Stack Overflow to see if any other user perhaps found a workaround.

    ( We do like to give examples for certain solutions, but for this use-case, we, unfortunately, don't have anything yet)


    I will still follow up with our developers, and if they manage to create a custom workaround solution for this soon, we will make sure to let you know.

    Thank you.

    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