What is the correct way of adding a bottom border to an arbitrary row in a table in Spire.DOC for Java?
I create a table based on database data, and at specific point in processing (currently processing row 3) I try to add a bottom border to that row. Below is the function I use in adding a border to a table row.
- Code: Select all
private void addBottomBorderToRow(Table dataTable, int rowIndex) {
log.error("ADD BORDER TO {}", rowIndex);
var row = dataTable.getRows().get(rowIndex);
var format = row.getRowFormat();
var bottom = format.getBorders().getBottom();
bottom.setBorderType(BorderStyle.Single);
bottom.setColor(Color.RED);
}
However, after document has been created, the border is at the bottom of the table, not on the third row as logged by the function.
When I tried to convert the above function so that it would get all cells from the row, and add bottom border to all cells, then every row of the table had a bottom border.
I'm currently using Spire.DOC 13.12.2, and at the moment cannot update due to client process.