mk-j / PHP_XLSXWriter

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

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

Open saltedfishDing opened 11 months ago

saltedfishDing commented 11 months ago

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

test8git commented 1 month 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 1 month ago

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