openpyxl.styles.borders module

class openpyxl.styles.borders.Border(left=None, right=None, top=None, bottom=None, diagonal=None, diagonal_direction=None, vertical=None, horizontal=None, diagonalUp=False, diagonalDown=False, outline=True, start=None, end=None)[source]

Bases: Serialisable

Border positioning for use in styles.

bottom

Values must be of type <class ‘openpyxl.styles.borders.Side’>

diagonal

Values must be of type <class ‘openpyxl.styles.borders.Side’>

diagonalDown

Values must be of type <class ‘bool’>

diagonalUp

Values must be of type <class ‘bool’>

end

Values must be of type <class ‘openpyxl.styles.borders.Side’>

horizontal

Values must be of type <class ‘openpyxl.styles.borders.Side’>

left

Values must be of type <class ‘openpyxl.styles.borders.Side’>

outline

Values must be of type <class ‘bool’>

right

Values must be of type <class ‘openpyxl.styles.borders.Side’>

start

Values must be of type <class ‘openpyxl.styles.borders.Side’>

tagname = 'border'
top

Values must be of type <class ‘openpyxl.styles.borders.Side’>

vertical

Values must be of type <class ‘openpyxl.styles.borders.Side’>

class openpyxl.styles.borders.Side(style=None, color=None, border_style=None)[source]

Bases: Serialisable

Border options for use in styles. Caution: if you do not specify a border_style, other attributes will have no effect !

border_style

Value must be one of {‘mediumDashDot’, ‘double’, ‘slantDashDot’, ‘mediumDashed’, ‘hair’, ‘thin’, ‘thick’, ‘dotted’, ‘mediumDashDotDot’, ‘medium’, ‘dashed’, ‘dashDot’, ‘dashDotDot’}

color

Values must be of type <class ‘openpyxl.styles.colors.Color’>

style

Value must be one of {‘mediumDashDot’, ‘double’, ‘slantDashDot’, ‘mediumDashed’, ‘hair’, ‘thin’, ‘thick’, ‘dotted’, ‘mediumDashDotDot’, ‘medium’, ‘dashed’, ‘dashDot’, ‘dashDotDot’}