Files
HtmlRW/Sources/HRW/GenHTML/Elements/Colgroup.swift
2025-09-23 20:22:59 -04:00

57 lines
1.4 KiB
Swift

//
// Colgroup.swift
// HTMLStandard
//
// Generated on 09/23/2025.
// THIS FILE IS GENERATED. DO NOT EDIT.
//
import Foundation
/// <colgroup> Group of columns in a table
public class Colgroup : HTMLNode {
/// Number of columns spanned by the element. Valid non-negative integer greater than zero.
public var span:UInt? = nil
public init(_ attributes:[String:String], _ parser:XMLParser? = nil) throws {
var globalAttr = GlobalAttributesBuilder()
for (key, attValue) in attributes {
switch (key) {
case "span":
span = UInt(attValue)
continue
default: break
}
if globalAttr.trySetGlobalAttribute(key, attValue) {
continue
}
throw AppError("Unexpected attribute: \(key)")
}
var allItems:[HTMLNode] = []
while let obj = try parser?.readObject(endTag: "colgroup", xmlToHtmlMapper) {
allItems.append(obj)
}
super.init(globalAttr, allItems)
}
public override func renderAttributes() -> String {
var result = super.renderAttributes()
if let span = span {
result += " span='\(span)'"
}
return result
}
override var nodeName: String {
return "colgroup"
}
override var isVoidElement: Bool {
return false
}
}