2016-12-30 19 views

答えて

2
ような何かをしたい、私は動的にこの

$row_count = 2; 
for($i=0; $i < count($student_data); $i++) { 
    $sheet->Row($row_count, array(
    $student_data[$i]->stud_number, 
    $student_data[$i]->first_name .' ' .$student_data[$i]->last_name 
)); 
    $row_count++; 
} 

$sheet->cells('A1:I'.$row_count, function($cells) { 
    $cells->setAlignment('center'); 
}); 

のような行を生成することができますしかし、私は動的に列を生成することはできません

あなたもアルファベット順にインクリメントすることができます

$current_column = 'C'; 

for($i=0; $i < count($subject_data); $i++) { 
    print $current_column; // Will be C, D, E, etc... 
    $current_column++; // Increment letter 
} 
0

をあなたが任意のセルをmanpulateできdocを1としてセル名で

$sheet->cell('A1', function($cell) { 

    // manipulate the cell 
    $cell->setValue('data1'); 

}); 
関連する問題