diff --git a/Examples/42richText.php b/Examples/42richText.php index 0016272..4e99b85 100644 --- a/Examples/42richText.php +++ b/Examples/42richText.php @@ -78,11 +78,16 @@ $html2='

'; +$html3='23 equals 8'; + +$html4='H2SO4 is the chemical formula for Sulphuric acid'; + + $wizard = new PHPExcel_Helper_HTML; $richText = $wizard->toRichTextObject($html1); $objPHPExcel->setActiveSheetIndex(0) - ->setCellValue('A1', $richText); + ->setCellValue('A1', $richText); $objPHPExcel->getActiveSheet()->getColumnDimension('A')->setWidth(48); $objPHPExcel->getActiveSheet()->getRowDimension(1)->setRowHeight(-1); @@ -93,13 +98,19 @@ $objPHPExcel->getActiveSheet()->getStyle('A1') $richText = $wizard->toRichTextObject($html2); $objPHPExcel->setActiveSheetIndex(0) - ->setCellValue('A2', $richText); + ->setCellValue('A2', $richText); $objPHPExcel->getActiveSheet()->getRowDimension(1)->setRowHeight(-1); $objPHPExcel->getActiveSheet()->getStyle('A2') ->getAlignment() ->setWrapText(true); +$objPHPExcel->setActiveSheetIndex(0) + ->setCellValue('A3', $wizard->toRichTextObject($html3)); + +$objPHPExcel->setActiveSheetIndex(0) + ->setCellValue('A4', $wizard->toRichTextObject($html4)); + // Rename worksheet echo date('H:i:s') , " Rename worksheet" , EOL;