Sha256: 4e1247b2c47ce6ecae429cba9bfbbe7e314c958f0cb6fb429aef5de3d74f0190

Contents?: true

Size: 667 Bytes

Versions: 11

Compression:

Stored size: 667 Bytes

Contents

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

11 entries across 11 versions & 1 rubygems

Version Path
coursegen-0.8.3 lib/coursegen/course/helpers/table_helpers.rb
coursegen-0.8.2 lib/coursegen/course/helpers/table_helpers.rb
coursegen-0.8.1 lib/coursegen/course/helpers/table_helpers.rb
coursegen-0.7.7 lib/coursegen/course/helpers/table_helpers.rb
coursegen-0.7.6 lib/coursegen/course/helpers/table_helpers.rb
coursegen-0.7.5 lib/coursegen/course/helpers/table_helpers.rb
coursegen-0.7.4 lib/coursegen/course/helpers/table_helpers.rb
coursegen-0.7.3 lib/coursegen/course/helpers/table_helpers.rb
coursegen-0.7.2 lib/coursegen/course/helpers/table_helpers.rb
coursegen-0.7.1 lib/coursegen/course/helpers/table_helpers.rb
coursegen-0.7.0 lib/coursegen/course/helpers/table_helpers.rb