tr

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2026 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

	AttrAlign   = []byte(" align=\"")
	AttrBgColor = []byte(" bgcolor=\"")
	AttrChar    = []byte(" char=\"")
	AttrCharOff = []byte(" charoff=\"")
	AttrVAlign  = []byte(" valign=\"")
)

Byte constants for HTML rendering.

Functions

func Cells added in v0.3.0

func Cells(cells ...*td.Element) *element

Cells Creates a table row from td data cells, enforcing correct nesting at compile time. Example: tr.Cells(td.Text("a"), td.Text("b")) Renders: <tr><td>a</td><td>b</td></tr>

func Headers added in v0.3.0

func Headers(cells ...*th.Element) *element

Headers Creates a table row from th header cells, enforcing correct nesting at compile time. Example: tr.Headers(th.Col("Name"), th.Col("Age")) Renders: <tr><th scope="col">Name</th><th scope="col">Age</th></tr>

func New

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

New Creates a new table row element with optional child nodes (typically td or th elements). Example: tr.New() Renders: <tr></tr>

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