Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

185
Visualizações
JavaScript Change Specific Table Column Title

I have a table constructed using Ninja Tables in Wordpress, which filters pieces of data based on a string query passed in the URL. This table has 11 columns, for brevity each column is labeled 'col1','col2',col3',...'colx'. The Ninja Tables constructor allows for additional JavaScript code to modify parts of the table. I am looking to modify the 7th column header ('col7') if the URL query string matches an array of strings. The code I've assembled thus far is as follows:

$(document).ready(function customtask () {
        var queryString = window.location.search;
        var urlParams = new URLSearchParams(queryString);
        var finder = urlParams.get('variable'); //Say variable equals 'varone'
        console.log(finder);
        var list = ['varone', 'vartwo', 'varthree'];
        if (list.includes(finder)) {
            $("#footable_parent_#### .ninja_table_pro tr").eq(0).find('th').eq(7).html('A Cool String');
        } else {
        }
 });

Upon initialization of this table, I use the browser console to verify that the variable finder does equal 'varone' via console.log(finder). However, the script above does not change the 7th column header text, or any column text for that matter. What additional steps can be taken to ensure this code produces the desired result? Thanks!

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda