Spread 8.0 Documentation
Customizing Cell Borders
Support Options
User's Guide > Setting Up the Control > Working with Cells > Customizing Cell Borders

Glossary Item Box

Customizing Cell Borders


Overview

You can specify whether a cell or group of cells has a border. A group of cells can be a row, a column, a range of cells, or an entire sheet. If you have a border, it can be displayed on the left, right, top, or bottom, or around all four sides of a cell or cell range.

A border can be displayed as a solid, dashed, dotted, dash-dot, or dash-dot-dot line in regular and fine line weights. By default, no border is displayed.

You can customize the border color of a cell, a column, a row, a block of cells, or the entire sheet. If you want to specify the border color for a button cell, see Setting the Border Color for Button Cells.

You can specify more than one style and color for the same cell, column, row, or block of cells. The cell borders are drawn from left to right and top to bottom in the sheet. If two adjacent borders have a different style or color, the last one drawn has precedence and is the one that is displayed.

Cell borders reflect the precedence used by the sheet to determine the characteristics for sheet elements. That is, cell settings override row, column, and sheet settings, in that order. For more information, see Precedence of Settings.

Notes:
  • If two adjacent cells have different settings, the cell that is to the right or to the bottom has precedence.
    Keep in mind that the sheet is drawn from left to right and from top to bottom on the screen. Each subsequent cell's border properties take precedence over the cell drawn before it.
  • In the following example, a dotted, black border is set for each cell in the first five rows of column 2. Then a solid, blue border is set for the block B2:C4. Notice that the top and left sides of cell B2 and the left side of cells B3 and B4 display a solid, blue border. For these borders, the solid, blue border has precedence because it was set last. Also notice that cell B5 displays a dotted, black border on the top. Although the solid, blue border for the adjacent cell (the bottom border of cell B4) was set after the dotted, black border for the cell, cell B5 is drawn after cell B4.

  • If you want to return the border style or border color for an individual cell using the GetCellBorder method, set the Index parameter to specify the side for which you want to return the style or color. The style will be returned in the Style parameter and the color will be returned in the Color parameter.

Borders are different from grid lines in that they create a border around a cell or group of cells rather than distinguishing rows and columns. For more information about grid lines, see Customizing Grid Lines.

Note: The top and left borders of the cell displayed in the top-left corner of the sheet are not displayed. Keep this in mind if you choose not to display a border for the Spread control or headers for the sheet, as the result might be visually confusing.

Copyright © GrapeCity, inc. All rights reserved.