我正在尝试在满足此条件的第2行之后的每一行中的所有单元格的底部添加边框:
$objConditional1 = new PHPExcel_Style_Conditional();
$objConditional1->setConditionType(PHPExcel_Style_Conditional::CONDITION_EXPRESSION)
->setOperatorType(PHPExcel_Style_Conditional::OPERATOR_EQUAL)
->addCondition('AND((B2<>B3),B2<>"")');
$objConditional1->getStyle()->getBorders()->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
$conditionalStyles = $sheet->getStyle('B2')->getConditionalStyles();
array_push($conditionalStyles, $objConditional1);
$sheet->getStyle('B2')->setConditionalStyles($conditionalStyles);
$sheet->duplicateConditionalStyle(
$sheet->getStyle('B2')->getConditionalStyles(),
'B3:B9999'
);
我可以帮忙解决这个问题吗?
目标是这样:
答案 0 :(得分:2)
添加是在最后一行!做了工作.. ta da
$objConditional1 = new PHPExcel_Style_Conditional();
$objConditional1->setConditionType(PHPExcel_Style_Conditional::CONDITION_EXPRESSION)
->setOperatorType(PHPExcel_Style_Conditional::OPERATOR_EQUAL)
->addCondition('AND((B2<>B3),B2<>"")');
$objConditional1->getStyle()->getBorders()->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
$conditionalStyles = $sheet->getStyle('B2')->getConditionalStyles();
array_push($conditionalStyles, $objConditional1);
$sheet->getStyle('A$2:$U$10000')->setConditionalStyles($conditionalStyles);