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

197
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
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