Documentation
¶
Index ¶
- Variables
- type Cell
- type CellImpl
- type Cells
- type HtmlBuilder
- type Node
- func (n *Node) Add(v any, cb ...func(n *Node)) *Node
- func (n *Node) AddChild(child ...*Node) *Node
- func (n *Node) BuildTree() (tree *Tree)
- func (n *Node) Colspan() int
- func (n *Node) Rowspan() int
- func (n *Node) SetColspan(v int)
- func (n *Node) SetRowspan(v int)
- func (n *Node) SetVal(v any)
- func (n *Node) Val() any
- type Nodes
- type Rows
- type Tree
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultHtmlBuilder = &HtmlBuilder{ Begin: func(w io.Writer) (err error) { _, err = fmt.Fprintf(w, "<table cellspacing=\"0\" border=\"1\">\n\t<tbody>") return }, End: func(w io.Writer) (err error) { _, err = fmt.Fprintf(w, "\t</tbody>\n</table>\n") return }, Row: func(w io.Writer, index int) (close func() error, err error) { if _, err = w.Write([]byte("\t\t<tr>\n")); err != nil { return } return func() (err error) { _, err = w.Write([]byte("\t\t</tr>\n")) return }, nil }, Cell: func(w io.Writer, rowIndex, cellIndex int, cell Cell, attrs []string) (err error) { if _, err = w.Write([]byte("\t\t\t<td" + strings.Join(attrs, " ") + ">")); err != nil { return } if val := cell.Val(); val != nil { if _, err = fmt.Fprint(w, val); err != nil { return } } _, err = w.Write([]byte("</td>\n")) return }, }
Functions ¶
This section is empty.
Types ¶
type CellImpl ¶
type CellImpl struct {
ValValue any `json:"val,omitempty"`
RowspanValue int `json:"rowspan,omitempty"`
ColspanValue int `json:"colspan,omitempty"`
}
func (*CellImpl) SetColspan ¶
func (*CellImpl) SetRowspan ¶
type HtmlBuilder ¶
Click to show internal directories.
Click to hide internal directories.