Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
99b000ecf4
|
|||
a173e30090
|
|||
a3481a7d2d
|
|||
a8e6f98a89
|
@@ -1,5 +1,5 @@
|
||||
package goext
|
||||
|
||||
const GoextVersion = "0.0.500"
|
||||
const GoextVersion = "0.0.504"
|
||||
|
||||
const GoextVersionTimestamp = "2024-08-07T19:30:38+0200"
|
||||
const GoextVersionTimestamp = "2024-08-07T19:44:45+0200"
|
||||
|
@@ -53,8 +53,8 @@ func (b *TableBuilder) Widths(v ...string) *TableBuilder {
|
||||
return b
|
||||
}
|
||||
|
||||
func (b *TableBuilder) DefaultStyle(s TableCellStyleOpt) *TableBuilder {
|
||||
b.defaultCellStyle = &s
|
||||
func (b *TableBuilder) DefaultStyle(s *TableCellStyleOpt) *TableBuilder {
|
||||
b.defaultCellStyle = s
|
||||
return b
|
||||
}
|
||||
|
||||
@@ -137,11 +137,15 @@ func (b *TableBuilder) Build() {
|
||||
ellipsize := langext.Coalesce(style.ellipsize, true)
|
||||
cellPaddingHorz := langext.Coalesce(style.paddingHorz, 2)
|
||||
|
||||
fillHeight := langext.Coalesce(style.fillHeight, false)
|
||||
|
||||
bx := builder.GetX()
|
||||
by := builder.GetY()
|
||||
|
||||
cellWidth := columnWidths[cellIdx]
|
||||
|
||||
_ = fillHeight // TODO implement, but how?? ( cells with fillHeight=true should have a border of the full column height, even if another column is growing it, but we do not know teh height beforehand ... )
|
||||
|
||||
if langext.Coalesce(style.multiCell, true) {
|
||||
|
||||
builder.MultiCell(str, style.PDFCellOpt.Copy().ToMulti().Width(cellWidth).Debug(debug))
|
||||
|
@@ -20,6 +20,10 @@ type TableCellStyleOpt struct {
|
||||
PDFCellOpt
|
||||
}
|
||||
|
||||
func NewTableCellStyleOpt() *TableCellStyleOpt {
|
||||
return &TableCellStyleOpt{}
|
||||
}
|
||||
|
||||
func (o *TableCellStyleOpt) FillHeight(b bool) *TableCellStyleOpt {
|
||||
o.fillHeight = &b
|
||||
return o
|
||||
|
@@ -41,8 +41,8 @@ func (r *TableRowBuilder) CellObjects(cells ...TableCell) *TableRowBuilder {
|
||||
return r
|
||||
}
|
||||
|
||||
func (r *TableRowBuilder) CellWithStyle(cell string, style TableCellStyleOpt) *TableRowBuilder {
|
||||
r.cells = append(r.cells, TableCell{Content: cell, Style: style})
|
||||
func (r *TableRowBuilder) CellWithStyle(cell string, style *TableCellStyleOpt) *TableRowBuilder {
|
||||
r.cells = append(r.cells, TableCell{Content: cell, Style: *style})
|
||||
return r
|
||||
}
|
||||
|
||||
|
@@ -81,6 +81,8 @@ func TestPDFBuilder(t *testing.T) {
|
||||
Debug(false).
|
||||
Build()
|
||||
|
||||
builder.Ln(8)
|
||||
|
||||
builder.Table().
|
||||
Widths("auto", "20", "1fr", "20").
|
||||
PadX(2).
|
||||
|
Reference in New Issue
Block a user