Multiple font styles in a cell

Jan 9, 2011 at 2:27 AM

Is it possible to have multiple font styles in a cell? For example, if I have the text in a cell:

"Date: 01/01/2011"

Would it be possible to set "Date:" as bold and "01/01/2011" as normal text? How about different fonts or sizes?

Coordinator
Jan 9, 2011 at 8:07 AM

See section 4.6.37 of the Developer documentation, entitled "Add rich text to a cell".

Something lie:

$objRichText = new PHPExcel_RichText();
$textBold = $objRichText->createTextRun('Date: ');
$textBold->getFont()->setBold(true);
 
$objRichText->createText('01/01/2011');
 
$objPHPExcel->getActiveSheet()->getCell('A18')->setValue($objRichText);