Using the Java API’s, I’m not sure how I can control the font of a table cell.
Attached is a sample of the table I’m trying to produce. Here’s the code I currently have
com.aspose.words.Document doc = new com.aspose.words.Document(new ByteArrayInputStream(uploadFile.getFileData());
com.aspose.words.DocumentBuilder builder = new com.aspose.words.DocumentBuilder(doc);
builder.getRowFormat().setHeadingFormat(true);
builder.getRowFormat().setAllowBreakAcrossPages(true);
builder.insertCell();
builder.getCellFormat().setWidth(30 + 125 + 325 + 75 + 30 + 30);
builder.getCellFormat().setHorizontalMerge(com.aspose.words.CellMerge.FIRST);
builder.getCellFormat().setVerticalAlignment(com.aspose.words.CellVerticalAlignment.CENTER);
builder.writeln("This is row 1 cell 1");
builder.insertCell();
builder.getCellFormat().setWidth(0);
builder.getCellFormat().setHorizontalMerge(com.aspose.words.CellMerge.PREVIOUS);
builder.insertCell();
builder.getCellFormat().setWidth(0);
builder.getCellFormat().setHorizontalMerge(com.aspose.words.CellMerge.PREVIOUS);
builder.insertCell();
builder.getCellFormat().setWidth(0);
builder.getCellFormat().setHorizontalMerge(com.aspose.words.CellMerge.PREVIOUS);
builder.insertCell();
builder.getCellFormat().setWidth(0);
builder.getCellFormat().setHorizontalMerge(com.aspose.words.CellMerge.PREVIOUS);
builder.insertCell();
builder.getCellFormat().setWidth(0);
builder.getCellFormat().setHorizontalMerge(com.aspose.words.CellMerge.PREVIOUS);
builder.endRow();
builder.getRowFormat().setAllowBreakAcrossPages(true);
builder.insertCell();
builder.getCellFormat().setWidth(30);
builder.getCellFormat().setHorizontalMerge(com.aspose.words.CellMerge.NONE);
builder.getCellFormat().setVerticalAlignment(com.aspose.words.CellVerticalAlignment.CENTER);
builder.writeln("Lvl");
builder.insertCell();
builder.getCellFormat().setWidth(150);
builder.getCellFormat().setVerticalAlignment(com.aspose.words.CellVerticalAlignment.CENTER);
builder.writeln("Section");
builder.insertCell();
builder.getCellFormat().setWidth(325);
builder.getCellFormat().setVerticalAlignment(com.aspose.words.CellVerticalAlignment.CENTER);
builder.writeln("Critical Function");
builder.insertCell();
builder.getCellFormat().setWidth(75);
builder.getCellFormat().setVerticalAlignment(com.aspose.words.CellVerticalAlignment.CENTER);
builder.writeln("Critical # Staff");
builder.insertCell();
builder.getCellFormat().setWidth(30);
builder.getCellFormat().setVerticalAlignment(com.aspose.words.CellVerticalAlignment.CENTER);
builder.writeln("RTO");
builder.insertCell();
builder.getCellFormat().setWidth(30);
builder.getCellFormat().setVerticalAlignment(com.aspose.words.CellVerticalAlignment.CENTER);
builder.writeln("W/S");
builder.endRow();
builder.endTable();