table

package
v0.3.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TagOpen  = []byte("<table")
	TagClose = []byte("</table>")

	AttrBorder      = []byte(" border=\"")
	AttrCellPadding = []byte(" cellpadding=\"")
	AttrCellSpacing = []byte(" cellspacing=\"")
	AttrFrame       = []byte(" frame=\"")
	AttrRules       = []byte(" rules=\"")
	AttrSummary     = []byte(" summary=\"")
	AttrWidth       = []byte(" width=\"")
)

Byte constants for HTML rendering.

Functions

func New

func New(nodes ...node.Node) *element

New Creates a new table element with optional child nodes (typically thead, tbody, tfoot, tr elements). Example: table.New() Renders: <table></table>

func Rows added in v0.3.0

func Rows(rows ...*tr.Element) *element

Rows Creates a simple table from tr rows, enforcing correct nesting at compile time. For tables needing thead, tbody, or tfoot, use New() instead. Example: table.Rows(tr.Cells(td.Text("a"), td.Text("b"))) Renders: <table><tr><td>a</td><td>b</td></tr></table>

Types

type Element

type Element = element

Element is an exported alias for the private element type

Jump to

Keyboard shortcuts

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