user12916796
user12916796

Reputation: 191

Bold font to only one word from a cell

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);

Upvotes: 1

Views: 432

Answers (1)

John Haugeland
John Haugeland

Reputation: 9668

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

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

Upvotes: 0

Related Questions