class Grapple::HtmlTableBuilder

Public Instance Methods

after_container() click to toggle source

HTML to render after the container

# File lib/grapple/html_table_builder.rb, line 39
def after_container
        ''
end
before_container() click to toggle source

HTML to render before the container

# File lib/grapple/html_table_builder.rb, line 34
def before_container
        ''
end
container(inner_html) click to toggle source

Wrap the table in a div

# File lib/grapple/html_table_builder.rb, line 18
def container(inner_html)
        html = ''
        html << before_container
        html << template.tag('div', container_attributes, true) + "\n"
        html << inner_html
        html << "</div>\n"
        html << after_container
        return html.html_safe
end
container_attributes() click to toggle source

HTML attributes for the container

# File lib/grapple/html_table_builder.rb, line 29
def container_attributes
        { class: 'grapple' }
end
table(content, attributes = {}) click to toggle source
# File lib/grapple/html_table_builder.rb, line 13
def table(content, attributes = {})
        "#{template.content_tag('table', content, attributes)}\n".html_safe
end