Sha256: 2e67ac4a6cce95c432add0a5a212240364fc5d65901f5893dcf17b9943d0e571
Contents?: true
Size: 724 Bytes
Versions: 18
Compression:
Stored size: 724 Bytes
Contents
# Class TableHelper provides methods for creating a table. class TableHelper def initialize(*property) @prop = property @bm = BootstrapMarkup.new end def headers(*labels) css_style = '' css_style += ' table-condensed' if @prop.include? :normal css_style += ' table-bordered' if @prop.include? :bordered @bm.table_begin(css_style) @bm.headers_begin labels.each do |h| @bm.header_begin @bm.header_content(h) @bm.header_end end @bm.headers_end end def row(*cells) @bm.row_begin cells.each do |c| @bm.cell_begin @bm.cell_content(c) @bm.cell_end end @bm.row_end end def render @bm.table_end @bm.render end end
Version data entries
18 entries across 18 versions & 1 rubygems