openpyxl.styles.borders module

class openpyxl.styles.borders.Border(left=<openpyxl.styles.borders.Side object> Parameters: style=None, color=None, right=<openpyxl.styles.borders.Side object> Parameters: style=None, color=None, top=<openpyxl.styles.borders.Side object> Parameters: style=None, color=None, bottom=<openpyxl.styles.borders.Side object> Parameters: style=None, color=None, diagonal=<openpyxl.styles.borders.Side object> Parameters: style=None, color=None, diagonal_direction=None, vertical=None, horizontal=None, diagonalUp=False, diagonalDown=False, outline=True, start=None, end=None)[source]

Bases: openpyxl.descriptors.serialisable.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: openpyxl.descriptors.serialisable.Serialisable

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

border_style

Aliases can be used when either the desired attribute name is not allowed or confusing in Python (eg. “type”) or a more descriptve name is desired (eg. “underline” for “u”)

color

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

style

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