PHPExcel我只能在单元格中加粗某些单词吗

时间:2018-07-23 11:46:13

标签: php excel phpexcel

我只能在单个单元格中将phpExcel上的某些单词加粗吗?

$excel = new PHPExcel();

$excel->setActiveSheetIndex(0);
$row = 5;

//MERGE title
$excel->getActiveSheet()->mergeCells('A1:P1');
$excel->getActiveSheet()
    ->setCellValue('A1', 'How to bold certain word on phpexcel
');

$excel->getActiveSheet()->getStyle('A1:P1')->applyFromArray(
      array(
        'font'=> array(
              'bold' => true,
              'size' => 14,
              'name' => 'Arial',
        ),
        'borders' => array(
          'allborders' => array(
            'style'=> PHPExcel_style_Border::BORDER_THIN
          )
        )
      )
  );

如果我使用上面的代码,我的所有单词都将以粗体显示,我只能将单词“ word on”以粗体显示吗?

0 个答案:

没有答案