https://github.com/dbackowski/table_helpers
Rails table helpers
https://github.com/dbackowski/table_helpers
Last synced: about 1 year ago
JSON representation
Rails table helpers
- Host: GitHub
- URL: https://github.com/dbackowski/table_helpers
- Owner: dbackowski
- License: mit
- Created: 2011-01-29T15:45:06.000Z (over 15 years ago)
- Default Branch: master
- Last Pushed: 2013-10-04T06:42:24.000Z (over 12 years ago)
- Last Synced: 2025-04-11T05:48:09.838Z (about 1 year ago)
- Language: Ruby
- Homepage:
- Size: 137 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: MIT-LICENSE
Awesome Lists containing this project
README
# TableHelpers
Rails 3.x table helpers plugin.
## Examples
table_list:
```ruby
<%= table_list :class => 'list' do |t| %>
<%= t.headers ['First column', 'Second column'] %>
<%= t.tr do |tr| %>
<%= tr.td 'Example 1' %>
<%= tr.td 'Example 2', :class => 'options' %>
<% end %>
<% end %>
```
HTML output:
```html
First column
Second column
Example 1
Example 2
```
table_data:
```ruby
<%= table_data :label_size => 150 do |t| %>
<%= t.row 'Label name:', 'Data' %>
<%= t.section 'Next section:' %>
<%= t.row 'Label name 2:', 'Data 2' %>
<% end %>
```
HTML output:
```html
Label name:
Data
Next section:
Label name 2 :
Data 2:
```
Copyright (c) 2012 Damian Baćkowski, released under the MIT license