Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

187
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda