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

196
Visualizações
jspdf is coloring the first row and header

I am trying to color only the first row , It is working well but the problem it is coloring the header also in the same time, Do anyone has an idea? I am using jspdf This is the snippet code

if (new Date(tableaudate[0]).getDay() === 0) {
          if (data.row.index === 0) {
            data.cell.styles.fillColor = [211, 211, 211];
            console.log(data);
          }
        }

I have added this piece of code after in order to overwrite any style but it is not working :

options.headStyles = {
      fillColor: [23, 55, 100],
      textColor: '#FFFFFF',
      minCellHeight: 8,
      fontSize: 8
    };

It is applying the style of the first row in the header. Please do anyone has an idea about this problem?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

In fact the problem comes that head and body have same index so to distinct this is the solution : added this piece of code

&& data.row.section !== 'head'


 if (new Date(tableaudate[0]).getDay() === 0) {
          if (data.row.index === 0 && data.row.section !== 'head') {
            data.cell.styles.fillColor = [211, 211, 211];
          }
        }
about 4 years ago · Juan Pablo Isaza Relatório
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