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

465
Visualizações
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 à 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