0

How do I write a sentence with 2 color in one cell like this using SheetJs ??

Below is my code, Im writing the sheet using aoa_to_sheet

const headerText1 = 'Device No. that in inserted in RWB but';
  const headerText2 = 'NOT RETURN';
  const headerText3 = `from GPS Vendor (${deviceData.dataInMonth})`;
  const worksheet = XLSX.utils.aoa_to_sheet([
    [
      {
        v: headerText1,
        t: 's',
        s: { font: { bold: true, sz: 15 } },
      },
      {
        v: headerText2,
        t: 's',
        s: { font: { bold: true, sz: 15, color: { rgb: 'FF0000' } } },
      },
      {
        v: headerText3,
        t: 's',
        s: { font: { bold: true, sz: 15 } },
      },
    ],
    ['Type Of Device', 'Device No'],
    ...chartArray,
  ]);

But it didnt get what I want , the 3 header is separate into 3 cell , how do I combine them into one cell ?

0 Answers0