Sha256: cb8d2d9939f6b06c8dfc5e9d5684bc2750d54fa7a8356da1547100a2b6662999

Contents?: true

Size: 913 Bytes

Versions: 1

Compression:

Stored size: 913 Bytes

Contents

class RenderTable::Table < RenderTable::Base
  def template
    <<-HTML
      <table id="<%= table.table_id %>" class="<%= table.table_class %>">
        <thead>
          <tr>
            <% table.header.each do |header| %>
              <th><%= header.to_s %></th>
            <% end %>
            <% if table.options %>
              <th></th>
            <% end %>
          </tr>
        </thead>
        <tbody>
        <% table.rows.each do |row| %>
          <tr id="<%= row.id %>" class="<%= row.class %>">
            <% row.cells.each do |cell| %>
              <td id="<%= cell.id %>" class="<%= cell.class %>">
                <%= cell.value %>
              </td>
            <% end %>
            <% if table.options %>
              <td><%= options_cell(row.record, row.row_index) %></td>
            <% end %>
          </tr>
        <% end %>
        </tbody>
      </table>
    HTML
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
render_table-1.1.1 lib/render_table/table.rb