Sha256: ebff0c397499c2773e16f6f7ea6a2bf7de70a88c1c09c017ad5f80b0ee4175a9
Contents?: true
Size: 1.41 KB
Versions: 3
Compression:
Stored size: 1.41 KB
Contents
# frozen_string_literal: true require 'data-table/version' require 'data-table/table' require 'data-table/column' require 'data-table/enum' module DataTable def self.render(collection, &_blk) # make a new table t = DataTable::Table.new(collection) # yield it to the block for configuration yield t # modify the data structure if necessary and do calculations t.prepare_data # render the table t.render end def self.default_css_styles <<-CSS_STYLE .data_table {width: 100%; empty-cells: show} .data_table td, .data_table th {padding: 3px} .data_table caption {font-size: 2em; font-weight: bold} .data_table thead th {background-color: #ddd; border-bottom: 1px solid #bbb;} .data_table tbody tr.alt {background-color: #eee;} .data_table .group_header th {text-align: left;} .data_table .subtotal.first td, .data_table .parent_subtotal.first td { border-top: 1px solid #000; } .data_table tfoot .total.index_0 td { border-top: 1px solid #000; } .empty_data_table {text-align: center; background-color: #ffc;} /* Data Types */ .data_table .number, .data_table .money {text-align: right} .data_table .text {text-align: left} .level_1, .level_2 { text-align: left } .level_2 th { padding-left: 35px; } CSS_STYLE end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
data-table-2.0.3 | lib/data-table.rb |
data-table-2.0.2 | lib/data-table.rb |
data-table-2.0.1 | lib/data-table.rb |