// ------------------------------- // 4. Empty Rows (for 10 family members) // ------------------------------- for ($i = 1; $i <= 10; $i++) $dataRow = $row + $i; $sheet->setCellValue("A$dataRow", $i); for ($colIdx = 'B'; $colIdx <= 'H'; $colIdx++) $sheet->setCellValue($colIdx . $dataRow, '');
// Auto-size columns foreach (range('A', 'H') as $col) $sheet->getColumnDimension($col)->setAutoSize(true);
</script> This feature is production-ready, maintains an official look, and allows citizens or operators to manually fill family data before printing. Download Blangko Kartu Keluarga Kosong Excel
$row++; $sheet->setCellValue("A$row", 'RT/RW:'); $sheet->setCellValue("B$row", '____ / ____'); $sheet->setCellValue("D$row", 'Kel/Desa:'); $sheet->setCellValue("E$row", ' '); $sheet->setCellValue("G$row", 'Kecamatan:'); $sheet->setCellValue("H$row", ' ');
$sheet->mergeCells('A2:H2'); $sheet->setCellValue('A2', 'KELUARGA INTI / KELUARGA LAINNYA'); $sheet->getStyle('A2')->getFont()->setItalic(true); $sheet->getStyle('A2')->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER); // ------------------------------- // 4
$sheet->getStyle("A$dataRow:H$dataRow")->getBorders()->getAllBorders()->setBorderStyle(Border::BORDER_THIN);
wb.save("Blangko_KK_Kosong.xlsx") <button onclick="downloadKK()">📥 Download Blangko KK Kosong (Excel)</button> <script> function downloadKK() window.location.href = 'download_kk_blank.php'; $i++) $dataRow = $row + $i
$row++; $sheet->setCellValue("A$row", 'Alamat:'); $sheet->setCellValue("B$row", '_________________________'); $sheet->mergeCells("B$row:H$row");