mk-j / PHP_XLSXWriter

Lightweight XLSX Excel Spreadsheet Writer in PHP
MIT License
1.84k stars 665 forks source link

how do i set different font color in one cell #350

Open saltedfishDing opened 1 year ago

saltedfishDing commented 1 year ago

i tried this,not work $writer->writeSheetRow($sheet, "<span style='color:#ff0000'>Red Contents</span>Black Contents")

test8git commented 4 months ago

You need to send color option in an array. Below code will fill with 'RED' color to the 1st column and fill with 'GREEN' to the 2nd column

$writer->writeSheetRow($sheet, $rowData, $row_options = array(array('fill'=>'#FF0000'),array('fill'=>'#00FF00')));

sayid commented 4 months ago

您好,我已经收到您的信件,将尽快回复您。