colgroup

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: May 5, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Overview

Package colgroup provides constructors and methods for the HTML <colgroup> element.

The <colgroup> HTML element defines a group of columns within a table.

Index

Constants

This section is empty.

Variables

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

	AttrSpan = []byte(" span=\"")
)

Byte constants for HTML rendering.

Functions

func Cols added in v0.3.0

func Cols(cols ...*col.Element) *element

Cols creates a colgroup from col elements, enforcing correct nesting at compile time. Example: colgroup.Cols(col.New(), col.Span(2)) Renders: <colgroup><col /><col span="2" /></colgroup>

func New

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

New creates a new colgroup element with the given child nodes (typically <col> elements). Example: colgroup.New(col.New(), col.Span(2)) Renders: <colgroup><col /><col span="2" /></colgroup>

func Span added in v0.3.0

func Span(span int) *element

Span creates a colgroup that spans the given number of columns without requiring individual col children. Use this shorthand when all columns in the group share the same styling. Example: colgroup.Span(3) Renders: <colgroup span="3"></colgroup>

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