table

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 18, 2024 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ContentTypeParagraph = ContentType("paragraph")
	ContentTypeTable     = ContentType("table")
)
View Source
const (
	// HorizontalAlignmentStart
	// 表格以文本段的左侧沿线对齐
	HorizontalAlignmentStart = HorizontalAlignmentType("left")

	// HorizontalAlignmentEnd
	// 表格以文本段的右侧沿线对齐
	HorizontalAlignmentEnd = HorizontalAlignmentType("right")

	// HorizontalAlignmentCenter
	// 表格以文本段的居中位置显示
	HorizontalAlignmentCenter = HorizontalAlignmentType("center")
)
View Source
const (
	// LayoutTypeFixed
	// 表示表格的单元格布局固定,不会自动调整单元格宽高
	LayoutTypeFixed = LayoutType("fixed")

	// LayoutTypeAuto
	// 表示单元格宽高自动处理
	LayoutTypeAuto = LayoutType("autofit")
)
View Source
const (
	BorderStyleNil                    = BorderStyle("nil")
	BorderStyleNone                   = BorderStyle("none")
	BorderStyleSingle                 = BorderStyle("single")
	BorderStyleDashDotStroked         = BorderStyle("dashDotStroked")
	BorderStyleDashed                 = BorderStyle("dashed")
	BorderStyleDashSmallGap           = BorderStyle("dashSmallGap")
	BorderStyleDotDash                = BorderStyle("dotDash")
	BorderStyleDotDotDash             = BorderStyle("dotDotDash")
	BorderStyleDotted                 = BorderStyle("dotted")
	BorderStyleDouble                 = BorderStyle("double")
	BorderStyleDoubleWave             = BorderStyle("doubleWave")
	BorderStyleInset                  = BorderStyle("inset")
	BorderStyleOutset                 = BorderStyle("outset")
	BorderStyleThick                  = BorderStyle("thick")
	BorderStyleThickThinLargeGap      = BorderStyle("thickThinLargeGap")
	BorderStyleThickThinMediumGap     = BorderStyle("thickThinMediumGap")
	BorderStyleThickThinSmallGap      = BorderStyle("thickThinSmallGap")
	BorderStyleThinThickLargeGap      = BorderStyle("thinThickLargeGap")
	BorderStyleThinThickMediumGap     = BorderStyle("thinThickMediumGap")
	BorderStyleThinThickSmallGap      = BorderStyle("thinThickSmallGap")
	BorderStyleThinThickThinLargeGap  = BorderStyle("thinThickThinLargeGap")
	BorderStyleThinThickThinMediumGap = BorderStyle("thinThickThinMediumGap")
	BorderStyleThinThickThinSmallGap  = BorderStyle("thinThickThinSmallGap")
	BorderStyleThreeDEmboss           = BorderStyle("threeDEmboss")
	BorderStyleThreeDEngrave          = BorderStyle("threeDEngrave")
	BorderStyleTriple                 = BorderStyle("triple")
	BorderStyleWave                   = BorderStyle("wave")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Background

type Background struct {
	// contains filtered or unexported fields
}

Background 背景配置结构

func (*Background) GetBackgroundColor

func (b *Background) GetBackgroundColor() string

GetBackgroundColor 获取背景色

func (*Background) GetColor

func (b *Background) GetColor() string

GetColor 获取前景色

func (*Background) GetXmlBytes

func (b *Background) GetXmlBytes() ([]byte, error)

func (*Background) SetBackgroundColor

func (b *Background) SetBackgroundColor(color string) *Background

SetBackgroundColor 设置背景色,不包含#号

func (*Background) SetColor

func (b *Background) SetColor(color string) *Background

SetColor 设置前景色,不包含#号

func (*Background) SetMask

func (b *Background) SetMask(val string) *Background

SetMask

type Border

type Border struct {
	// Color 颜色值,以十六进制字符串设置,不包含#号,例如FF0000
	Color string

	// Shadow 是否显示阴影
	Shadow bool

	// Space 间距偏移量,以磅(1/72英寸)为单位
	Space uint

	// Size 边框宽度
	// 最小值是2,最大值是96
	Size uint8

	// Style 边框样式
	// 段落边框只能是线条边框
	Style BorderStyle
}

Border 边框结构定义

type BorderManager

type BorderManager struct {
	// contains filtered or unexported fields
}

BorderManager 边框管理器

func (*BorderManager) GetXmlBytes

func (b *BorderManager) GetXmlBytes() ([]byte, error)

func (*BorderManager) SetBorder

func (b *BorderManager) SetBorder(style BorderStyle, color string, size uint8, space uint, shadow bool) *BorderManager

SetBorder 统一设置边框样式

func (*BorderManager) SetBottom

func (b *BorderManager) SetBottom(style BorderStyle, color string, size uint8, space uint, shadow bool) *BorderManager

SetBottom 设置底部边框

func (*BorderManager) SetInsideHorizontal

func (b *BorderManager) SetInsideHorizontal(style BorderStyle, color string, size uint8, space uint, shadow bool) *BorderManager

SetInsideHorizontal 设置表格内行间边框

func (*BorderManager) SetInsideVertical

func (b *BorderManager) SetInsideVertical(style BorderStyle, color string, size uint8, space uint, shadow bool) *BorderManager

SetInsideVertical 设置表格内列间边框

func (*BorderManager) SetLeft

func (b *BorderManager) SetLeft(style BorderStyle, color string, size uint8, space uint, shadow bool) *BorderManager

SetLeft 设置左侧边框

func (*BorderManager) SetRight

func (b *BorderManager) SetRight(style BorderStyle, color string, size uint8, space uint, shadow bool) *BorderManager

SetRight 设置右侧边框

func (*BorderManager) SetTop

func (b *BorderManager) SetTop(style BorderStyle, color string, size uint8, space uint, shadow bool) *BorderManager

SetTop 设置顶部边框

type BorderStyle

type BorderStyle string

type Cell

type Cell struct {
	// contains filtered or unexported fields
}

Cell 表格单元格结构定义

func (*Cell) AddParagraph

func (c *Cell) AddParagraph() *paragraph.Paragraph

AddParagraph 添加一个段落

func (*Cell) AddTable

func (c *Cell) AddTable() *Table

AddTable 添加一个表格

func (*Cell) GetContents

func (c *Cell) GetContents() []*Content

GetContents 获取所有内容列表

func (*Cell) GetProperties

func (c *Cell) GetProperties() *cell.TcPr

GetProperties 获取属性配置结构

func (*Cell) GetXmlBytes

func (c *Cell) GetXmlBytes() ([]byte, error)

type CellMargin

type CellMargin struct {
	// contains filtered or unexported fields
}

CellMargin 单元格边距管理器

func (*CellMargin) GetBottom

func (c *CellMargin) GetBottom() int

GetBottom

func (*CellMargin) GetLeft

func (c *CellMargin) GetLeft() int

GetLeft

func (*CellMargin) GetRight

func (c *CellMargin) GetRight() int

GetRight

func (*CellMargin) GetTop

func (c *CellMargin) GetTop() int

GetTop

func (*CellMargin) GetXmlBytes

func (c *CellMargin) GetXmlBytes() ([]byte, error)

func (*CellMargin) SetBottom

func (c *CellMargin) SetBottom(bottom int) *CellMargin

SetBottom 设置下边距

func (*CellMargin) SetGroup

func (c *CellMargin) SetGroup(topAndBottom int, LeftAndRight int) *CellMargin

SetGroup 分组设置边距

func (*CellMargin) SetLeft

func (c *CellMargin) SetLeft(left int) *CellMargin

SetLeft 设置左边距

func (*CellMargin) SetMargin

func (c *CellMargin) SetMargin(margin int) *CellMargin

SetMargin 设置全部边距

func (*CellMargin) SetRight

func (c *CellMargin) SetRight(right int) *CellMargin

SetRight 设置右边距

func (*CellMargin) SetTop

func (c *CellMargin) SetTop(top int) *CellMargin

SetTop 设置上边距

type Content

type Content struct {
	// contains filtered or unexported fields
}

type ContentType

type ContentType string

type GridCol

type GridCol struct {
	// contains filtered or unexported fields
}

GridCol 表格列定义

func (*GridCol) GetWidth

func (g *GridCol) GetWidth() int

GetWidth 获取宽度

func (*GridCol) GetXmlBytes

func (g *GridCol) GetXmlBytes() ([]byte, error)

func (*GridCol) SetWidth

func (g *GridCol) SetWidth(w int) *GridCol

SetWidth 设置宽度

type HorizontalAlignmentType

type HorizontalAlignmentType string

type LayoutType

type LayoutType string

type Row

type Row struct {
	// contains filtered or unexported fields
}

Row 表格行结构定义

func (*Row) AddCellText

func (r *Row) AddCellText(cells ...interface{}) error

AddCellText 添加指定数量单元格的文本内容

func (*Row) GetCell

func (r *Row) GetCell(index uint) (*Cell, error)

GetCell 获取指定位置的单元格

func (*Row) GetCells

func (r *Row) GetCells() []*Cell

GetCells 获取全部单元格

func (*Row) GetProperties

func (r *Row) GetProperties() *row.TrPr

GetProperties 获取属性配置结构

func (*Row) GetXmlBytes

func (r *Row) GetXmlBytes() ([]byte, error)

type Table

type Table struct {
	// contains filtered or unexported fields
}

Table 表格结构定义

func (*Table) AddCol

func (t *Table) AddCol() *GridCol

AddCol 添加一列

func (*Table) AddColWithIndexAndWidth

func (t *Table) AddColWithIndexAndWidth(index int, width int) *GridCol

AddColWithIndexAndWidth 添加一列并指定位置及宽度

func (*Table) AddColWithWidth

func (t *Table) AddColWithWidth(width int) *GridCol

AddColWithWidth 添加一列并设置列宽

func (*Table) AddRow

func (t *Table) AddRow() *Row

AddRow 添加一行

func (*Table) AddRowWithIndex

func (t *Table) AddRowWithIndex(index uint) *Row

AddRowWithIndex 添加一行到指定位置

func (*Table) GetCol

func (t *Table) GetCol(index int) (*GridCol, error)

GetCol 获取指定列结构

func (*Table) GetCols

func (t *Table) GetCols() []*GridCol

GetCols 获取所有列结构

func (*Table) GetProperties

func (t *Table) GetProperties() *TblPr

GetProperties 获取属性配置结构

func (*Table) GetRow

func (t *Table) GetRow(index uint) (*Row, error)

GetRow 获取指定行结构

func (*Table) GetRows

func (t *Table) GetRows() []*Row

func (*Table) GetXmlBytes

func (t *Table) GetXmlBytes() ([]byte, error)

type TblPr

type TblPr struct {
	// contains filtered or unexported fields
}

TblPr 表格属性配置

func (*TblPr) GetBorder

func (t *TblPr) GetBorder() *BorderManager

GetBorder 获取边框管理器

func (*TblPr) GetCellMargin

func (t *TblPr) GetCellMargin() *CellMargin

GetCellMargin 获取单元格边距管理器

func (*TblPr) GetExtraXmlBytes

func (t *TblPr) GetExtraXmlBytes() ([]byte, error)

GetExtraXmlBytes 获取外部样式

func (*TblPr) GetId

func (t *TblPr) GetId() string

GetId 获取ID

func (*TblPr) GetInnerXmlBytes

func (t *TblPr) GetInnerXmlBytes() ([]byte, error)

GetInnerXmlBytes 获取内联样式

func (*TblPr) GetWidth

func (t *TblPr) GetWidth() int

GetWidth 获取表格宽度

func (*TblPr) SetCaption

func (t *TblPr) SetCaption(caption string) *TblPr

SetCaption 设置标题

func (*TblPr) SetCellSpacing

func (t *TblPr) SetCellSpacing(spacing int) *TblPr

SetCellSpacing 设置单元格间距

func (*TblPr) SetHorizontalAlignment

func (t *TblPr) SetHorizontalAlignment(horizontalAlignment HorizontalAlignmentType) *TblPr

SetHorizontalAlignment 设置水平对齐

func (*TblPr) SetIndentation

func (t *TblPr) SetIndentation(indentation int) *TblPr

SetIndentation 设置缩进

func (*TblPr) SetLayout

func (t *TblPr) SetLayout(layout LayoutType) *TblPr

SetLayout 设置布局模式

func (*TblPr) SetWidth

func (t *TblPr) SetWidth(width int) *TblPr

SetWidth 设置宽度

func (*TblPr) SetWidthAuto

func (t *TblPr) SetWidthAuto() *TblPr

SetWidthAuto 设为宽度自动

Directories

Path Synopsis
row

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL