Skip to main content

Метод CellRange::setBorders

Метод предназначен для установки границ диапазона ячеек. Отдельные границы устанавливаются с помощью методов класса Borders.

Пример​


Table firstSheet = document.getBlocks().getTable(0).get();
Cell cell = firstSheet.getCell("A1");

LineProperties lineProperties = LineProperties();
lineProperties.style = LineStyle::Dash;
lineProperties.width = 1.5;
lineProperties.color = Color(ColorRGBA(255, 0, 0, 255));

Borders newBorders = Borders();
newBorders.setLeft(lineProperties);
newBorders.setRight(lineProperties);
newBorders.setTop(lineProperties);
newBorders.setBottom(lineProperties);

cell.setBorders(newBorders);