lib/html-native/collections.rb
# Converts the TableComponent instance to the equivalent HTML. 
#
# *render* can be called directly, but that usually isn't necessary.
# HTMLComponent::Builder handles this automatically, so it only needs to be 
# done if there is no prior instance of one.
Converts the TableComponent instance to the equivalent HTML.
render* can be called directly, but that usually isn't necessary.
HTMLComponent::Builder handles this automatically, so it only needs to be
done if there is no prior instance of one.
Converts the TableComponent instance to the equivalent HTML . render * can be called directly but that usually isn ' t necessary . HTMLComponent :: Builder handles this automatically so it only needs to be done if there is no prior instance of one .
def render
    table(@table_attributes) do
      unless @header.empty?
        tr(@row_attributes.merge(@header_attributes)) do
          @header.component_map do |h|
            th(@cell_attributes.merge(@header_cell_attributes)) {h}
          end
        end
      else
        Builder.new
      end +
      @rows.component_map do |row|
        attributes = {row: @row_attributes, cell: @cell_attributes}
        TableRowComponent.new(row, attributes: attributes, &@block)
      end
    end
  end
def render table ( @table_attributes ) do unless @header . empty? tr ( @row_attributes . merge ( @header_attributes ) ) do @header . component_map do | h | th ( @cell_attributes . merge ( @header_cell_attributes ) ) { h } end end else Builder . new end + @rows . component_map do | row | attributes = { row : @row_attributes , cell : @cell_attributes } TableRowComponent . new ( row , attributes : attributes , & @block ) end end end
Converts the TableComponent instance to the equivalent HTML.
Converts the TableComponent instance to the equivalent HTML .