Hi all,
 
How can I center a parent-title over some child-titles?
 
Example:
        HSSFRow row02 = sheet.createRow((short) 1);
        row02.createCell((short) 0).setCellValue("Title 1"); // Cell A2
        row02.createCell((short) 1).setCellValue("Title 2"); // Cell B2
        row02.createCell((short) 2).setCellValue("Title 3"); // Cell C2
 
        HSSFRow row01 = sheet.createRow((short) 0);
        HSSFCell cell = row01.createCell((short) 0);  // Cell A1
        cell.setCellValue("Parent Title");
        // TODO: Alignment over Cell A1 to Cell C1

The "Parent Title" should span from cell 0 to cell 2.
Can I use the HSSFCellStyle.ALIGN_CENTER_SELECTION for that?
How do I make a selection?
 
I know one possibility would be to do it with merged cells. But merged
cells have the disadvantage that it is not possible to have
partial-selections on the merged region (e.g. selection over C1, C2, C3
in my example).
 
Thanks a lot for any help.
 
Best regards,
Urban
 

Reply via email to