1
0
Fork 0
mirror of https://github.com/imjasonh/html synced 2026-07-07 00:23:26 +00:00
html/generated_col.go
Jason Hall 01c7432c71 Initial commit
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-01 13:08:43 -05:00

67 lines
1.5 KiB
Go

package html
// TableColElement represents the <col> HTML element.
type TableColElement basicElement[HTMLContent]
// Col creates a new <col> element.
func Col() *TableColElement {
return &TableColElement{
tagName: "col",
isVoid: true,
}
}
// Render returns the HTML string representation.
func (e *TableColElement) Render() string {
return (*basicElement[HTMLContent])(e).Render()
}
// Attr sets an arbitrary attribute as an escape hatch.
func (e *TableColElement) Attr(key, value string) *TableColElement {
e.attributes = append(e.attributes, Attribute{Key: key, Value: value})
return e
}
// Align sets the align attribute.
func (e *TableColElement) Align(v string) *TableColElement {
e.attributes = append(e.attributes, Attribute{Key: "align", Value: v})
return e
}
// Ch sets the ch attribute.
func (e *TableColElement) Ch(v string) *TableColElement {
e.attributes = append(e.attributes, Attribute{Key: "ch", Value: v})
return e
}
// ChOff sets the chOff attribute.
func (e *TableColElement) ChOff(v string) *TableColElement {
e.attributes = append(e.attributes, Attribute{Key: "chOff", Value: v})
return e
}
// VAlign sets the vAlign attribute.
func (e *TableColElement) VAlign(v string) *TableColElement {
e.attributes = append(e.attributes, Attribute{Key: "vAlign", Value: v})
return e
}
// Width sets the width attribute.
func (e *TableColElement) Width(v string) *TableColElement {
e.attributes = append(e.attributes, Attribute{Key: "width", Value: v})
return e
}