openpyxl.worksheet.merge module

class openpyxl.worksheet.merge.MergeCell(ref=None)[源代码]

基类:openpyxl.worksheet.cell_range.CellRange

property ref

Excel-style representation of the range

tagname = 'mergeCell'
class openpyxl.worksheet.merge.MergeCells(count=None, mergeCell=())[源代码]

基类:openpyxl.descriptors.serialisable.Serialisable

property count
mergeCell

A sequence (list or tuple) that may only contain objects of the declared type

tagname = 'mergeCells'
class openpyxl.worksheet.merge.MergedCellRange(worksheet, coord)[源代码]

基类:openpyxl.worksheet.cell_range.CellRange

MergedCellRange stores the border information of a merged cell in the top left cell of the merged cell. The remaining cells in the merged cell are stored as MergedCell objects and get their border information from the upper left cell.

format()[源代码]

Each cell of the merged cell is created as MergedCell if it does not already exist.

The MergedCells at the edge of the merged cell gets its borders from the upper left cell.

  • The top MergedCells get the top border from the top left cell.

  • The bottom MergedCells get the bottom border from the top left cell.

  • The left MergedCells get the left border from the top left cell.

  • The right MergedCells get the right border from the top left cell.