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

459
Vistas
How to display custom HTML inside AG-Grid column headers?

I'm trying to set the headerName of a column header as HTML in AG-Grid but the HTML is being escaped and a string is being set instead.

I'm aware that you can add a template under headerComponentParams in defaultColDef, however, this would be applied as a default to the whole table rather than just the individual header of a specific column. Following: https://www.ag-grid.com/javascript-data-grid/column-headers/

Is there any option to un-escape the HTML I'm trying to add as the headerName?

Is it possible to do this without creating a custom header component?

If not, what should we do?

const columnDefs = [
    {
          headerName: <span style="color:blue;">Forename</span>, 
          field: "forename", 
          suppressMenu: true
     },
     {
          headerName: <span style="font-size:20px;">Surname</span>, 
          field: "surname", 
          suppressMenu: true
     },
];

const gridOptions = {
    columnDefs: columnDefs,
    rowData: null,
    suppressMenuHide: true,
    defaultColDef: {
        sortable: true,
        resizable: true,
        filter: true,
        width: 150
        }
    }
};
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