问题描述
是否可以重复ListItem的编号(字母)?
PHPWORD软件包
当前,输出为:
vec.Count
我要输出:
List<string> vec = new List<string>();
vec.Add("Md.");
vec.Add("Ahsan");
vec.Add("Habib");
Console.WriteLine(vec.Count);
解决方法
$multilevelList1 = 'multilevel list 1'; // Normal numbering style
$multilevelList2 = 'multilevel list 2'; // Same style as previous one,but level 0 starts at 2 instead of 1
$phpWord->addNumberingStyle(
$multilevelList1,array(
'type' => 'multilevel','levels' => array(
array('format' => 'decimal','text' => '%1.','left' => 360,'hanging' => 360,'tabPos' => 360,'start' => 1),array('format' => 'upperLetter','text' => '%2.','left' => 720,'hanging' => 360,'tabPos' => 720),),)
);
$phpWord->addNumberingStyle(
$multilevelList2,'start' => 2),)
);
// New section
$section = $phpWord->addSection();
// Lists
$section->addListItem('One',null,$multilevelList1);
$section->addListItem('Two',$multilevelList1);
$section->addListItem('Alpha',1,$multilevelList1);
$section->addListItem('Beta',$multilevelList1);
$section->addListItem('Three',$multilevelList2);
$section->addListItem('Charlie',$multilevelList2);