Table

public struct Table: Html

A wrapper for the HTML ‘table’ element.

  • The HTML string generated for the content of this element.

    Declaration

    Swift

    public var html: String
  • Create a new ‘table’ element.

    Declaration

    Swift

    public init(_ klass: [String], _ id: String?, _ header: Thead?, _ body: Tbody?)

    Parameters

    klass

    The CSS class names that configure this element

    id

    The CSS id name that configure this element

    header

    The header element for this table

    body

    The body element for this table

  • Create a new ‘table’ element.

    Declaration

    Swift

    public init(klass: [String] = [], header: Thead? = nil, body: Tbody? = nil)

    Parameters

    klass

    (Optional) The CSS class names that configure this element

    header

    (Optional) The header element for this table

    body

    (Optional) The body element for this table

  • Create a new ‘table’ element.

    Declaration

    Swift

    public init(klass: String, header: Thead? = nil, body: Tbody? = nil)

    Parameters

    klass

    The CSS class name that configures this element

    header

    (Optional) The header element for this table

    body

    (Optional) The body element for this table

  • Create a new ‘table’ element.

    Declaration

    Swift

    public init(klass: [String] = [], columnTitles: [String])

    Parameters

    klass

    (Optional) The CSS class names that configure this element

    columnTitles

    The titles for the columns

  • Create a new ‘table’ element.

    Declaration

    Swift

    public init(klass: String, columnTitles: [String])

    Parameters

    klass

    The CSS class name that configures this element

    columnTitles

    The titles for the columns

  • Create a new ‘table’ element.

    Declaration

    Swift

    public init(klass: [String] = [], columnTitles: String...)

    Parameters

    klass

    (Optional) The CSS class names that configure this element

    columnTitles

    The titles for the columns

  • Create a new ‘table’ element.

    Declaration

    Swift

    public init(klass: String, columnTitles: String...)

    Parameters

    klass

    The CSS class name that configures this element

    columnTitles

    The titles for the column

  • Create a new ‘table’ element.

    Declaration

    Swift

    public init(id: String, header: Thead? = nil, body: Tbody? = nil)

    Parameters

    id

    The CSS id name that configures this element

    header

    (Optional) The header element for this table

    body

    (Optional) The body element for this table

  • Create a new ‘table’ element.

    Declaration

    Swift

    public init(id: String, columnTitles: [String])

    Parameters

    id

    The CSS id name that configures this element

    columnTitles

    The titles for the columns

  • Create a new ‘table’ element.

    Declaration

    Swift

    public init(id: String, columnTitles: String...)

    Parameters

    id

    The CSS id name that configures this element

    columnTitles

    The titles for the columns

  • Set the body of this table.

    Declaration

    Swift

    public mutating func set(body: Tbody)

    Parameters

    body

    The body to replace the current table body

  • Append the rows after the present rows.

    Declaration

    Swift

    public mutating func append(_ rows: Tr...)

    Parameters

    rows

    The rows to be added to this table.

  • Append the cells as a new row after the present rows.

    Declaration

    Swift

    public mutating func appendRow(_ cells: [Td])

    Parameters

    cells

    The cells to be added as a new row.

  • Append the cells as a new row after the present rows.

    Declaration

    Swift

    public mutating func appendRow(_ cells: Td...)

    Parameters

    cells

    The cells to be added as a new row.