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)[源代码]

基类: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)[源代码]

基类: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 {‘thin’, ‘dashDotDot’, ‘mediumDashDot’, ‘dashDot’, ‘dotted’, ‘mediumDashed’, ‘slantDashDot’, ‘hair’, ‘dashed’, ‘thick’, ‘mediumDashDotDot’, ‘double’, ‘medium’}