From 16f2eb63a126add20c06eebf901940500672b46e Mon Sep 17 00:00:00 2001 From: MarkBaker Date: Tue, 13 Jan 2015 23:44:38 +0000 Subject: [PATCH] Additional examples for HTML to Rich Text helper (superscript and subscript) --- Examples/42richText.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/Examples/42richText.php b/Examples/42richText.php index 00162723..4e99b853 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;