Bold font to only one word from a cell

332 Views Asked by At

How to set bold font to only one word from a cell? The documentation shows how to set all cells to a font type. As an example, I'll add a <b> tag to show which word will be in bold.

ws.cell(index + 4, 2).string(p[i].dataValues.diameter + '\n' + '<b>' + psw[i].dataValues.well + '</b>').style(styleText);
1

There are 1 best solutions below

0
John Haugeland On
const answer = [
  'you do it like',
  { bold: true, color: '00ff00' },
  'this',
  { bold: false, color: '000000' },
  '.'
];

worksheet.cell(1, 1).string(answer);