
## BorderCollection class

Encapsulates a collection of Border objects.

## Methods

| Name | Description |
| --- | --- |
| [getByBorderType(borderType)](#getbybordertype) | Gets the Border element at the specified index. |
| [getDiagonalColor()](#getdiagonalcolor) | Gets or sets the com.aspose.cells.Color of Diagonal lines. |
| [getDiagonalStyle()](#getdiagonalstyle) | Gets or sets the style of Diagonal lines. The value of the property is CellBorderType integer constant. |
| [setColor(color)](#setcolor) | Sets the com.aspose.cells.Color of all borders in the collection. |
| [setDiagonalColor()](#setdiagonalcolor) | Gets or sets the com.aspose.cells.Color of Diagonal lines. |
| [setDiagonalStyle()](#setdiagonalstyle) | Gets or sets the style of Diagonal lines. The value of the property is CellBorderType integer constant. |
| [setStyle(style)](#setstyle) | Sets the style of all borders of the collection. |

### getByBorderType(borderType) {#getbybordertype}

Gets the Border element at the specified index.

| Parameter | Type | Description |
| --- | --- | --- |
| borderType | Number | BorderType |

**Returns:** Border — `Border` The element at the specified index.

### getDiagonalColor() {#getdiagonalcolor}

Gets or sets the com.aspose.cells.Color of Diagonal lines.

### getDiagonalStyle() {#getdiagonalstyle}

Gets or sets the style of Diagonal lines. The value of the property is CellBorderType integer constant.

### setColor(color) {#setcolor}

Sets the com.aspose.cells.Color of all borders in the collection.

| Parameter | Type | Description |
| --- | --- | --- |
| color | Color | Borders' |

### setDiagonalColor() {#setdiagonalcolor}

Gets or sets the com.aspose.cells.Color of Diagonal lines.

### setDiagonalStyle() {#setdiagonalstyle}

Gets or sets the style of Diagonal lines. The value of the property is CellBorderType integer constant.

### setStyle(style) {#setstyle}

Sets the style of all borders of the collection.

| Parameter | Type | Description |
| --- | --- | --- |
| style | Number | CellBorderType |
