ExcelJS and formatting text

I’m trying to format a value in ExcelJS. I am targeting getCell(‘A1’) and the value should be: vehicle: CP0555LP-JHB(A) I need only the vehicle: to be bold and the rest of the text plain. Is this doable in the same cell?

So just to recap, I need it to be like this vehicle: CP0555LP-JHB(A) but just using cell(‘A1’). I tried several approaches but I am not sure one could do this without using for instance vehicle: in cell(‘A1’) and then the rest of the text in cell(‘B1’). Problem is I have set my columns widths so the last part of the text will be seperated to far.

  sheet.getCell('A1').value = {   richText: [     {       text: 'Vehicle: CP0555LP-JHB(A)',       font: { bold: true },     }   ] } 

Any help would be greatly appreciated.

Add Comment
0 Answer(s)

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.