Skip to content

Font Colors aren't Consistent #669

Closed
@jacoblockett

Description

@jacoblockett

I'm attempting to only change the font color of a row that is being passed into a function:

write(workbook, sheet, info, row_no, chart_path) {
  const worksheet = workbook.getWorksheet(sheet)
  const row = worksheet.getRow(row_no)
  const no_3 = info[2].slice(0, info[2].length - 1)

  row.font = {color: {argb: 'FFFF0000'}}

  row.eachCell({includeEmpty: true}, (cell, col_no) => {
    col_no === 1 && (cell.value = info[0])
    col_no === 2 && (cell.value = info[1])
    col_no > 3 && no_3.forEach((i, i_no) => {
      col_no - 4 === i_no && (cell.value = i)
    })
  })

  workbook.xlsx.writeFile(chart_path)
    .then(() => console.log('done'))
    .catch(error => console.error(error))
}

Unfortunately when I run this it changes every row between an arbitrary number (i.e. rows 5-14) instead of just the row I specify. Any reason for this that someone can see, or is this a bug?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy