def columns(*args, &block)
      column_options, html_options = get_column_and_html_options( args.extract_options! )
      @collection.each do |object|
        @current_object = object
        if block_given?
          @lines << FormatLine.new(args, column_options, html_options)
          yield(object)
        else
          @lines << FormatLine.new(args, column_options, html_options, object)
        end
      end
      render_tbody
    end
def columns(*args, &block)
      column_options, html_options = get_column_and_html_options( args.extract_options! )
      @collection.each do |object|
        @current_object = object
        if block_given?
          @lines << FormatLine.new(args, column_options, html_options)
          yield(object)
        else
          @lines << FormatLine.new(args, column_options, html_options, object)
        end
      end
      render_tbody
    end
Create the content of table with the values of collection (td) around tbody and tr.
 It can be called with or without a block, or with a list of columns.
 By default it will add the default actions (edit, delete).
 The method columns return the current object of the collection.
 These three exemples are equivalent:

  # With a list:
  <% sorting_table_for @users do |table| %>
    <%= table.columns :username, :firstname %>
  <% end %>

  # With a block:
  <% sorting_table_for @users do |table| %>
    <%= table.columns do %>
      <%= table.column :username %>
      <%= table.column :firstname %>
    <% end %>
  <% end %>

  # With a block and current object:
  <% sorting_table_for @users do |table| %>
    <%= table.columns do |user| %>
      <%= table.column user.username %>
      <%= table.column user.firstname %>
    <% end %>
  <% end %>

  # Output:
  <table class='sorting_table_for'>
    <tbody>
      <tr>
        <td>...</td>
        <td>...</td>
        <td><a href='/users/1/edit'>Edit<a></td>
        <td><a href='/users/1'>Delete</a></td>
      </tr>
      ...
    </tbody>
  </table>

 === Quick Columns

 When called without a block or a list, the columns are rendered for each column in
 the model's database table and the default actions (edit, delete).

  <% sorting_table_for @users do |table| %>
    <%= table.columns %>
  <% end %>

 === Options

 * :html - Hash options: class, id, ...
 * :actions - Set actions to render
 * :only - Columns only to render
 * :except - Columns to not render
 * :caption - set caption on td

  # Exemples:
  <% sorting_table_for @users do |table| %>
    <%= table.columns :username, :actions => [:edit, :delete] %>
  <% end %>

  <% sorting_table for @users do |table| %>
    <%= table.columns :except => [:created_at, :updated_at] %>
  <% end %>

 === I18n

 For each action, the name is set with the I18n translation.

  # Exemple of i18n_default_scope:
  SortingTableFor::TableBuilder.i18n_default_scope = [:controller, :action]

  # Ouput:
  I18n.t(:edit, :scope => [:current_controller, :current_action]) => en.current_controller.current_action.edit

 === Actions

 The option 'default_actions' contains the actions to add by default to the table. The link to actions
 is set by the collection sent to the method sorting_table_for.
 The name of action is set with I18n translation.

  # Exemple of default_actions:
  SortingTableFor::TableBuilder.default_actions = [:edit]

  # Ouput:
  link_to( I18n.t(:edit, :scope => [:current_controller, :current_action]), [:edit, user]) => /users/1/edit

 For action :delete the builder set a confirm message with I18n translation.

  # the I18n confirm message:
  I18n.t(:confirm_delete, :scope => [:current_controller, :current_action])

 === Total entries

 The first tr of the columns are the number of results in the collection. The line appears if
 option 'show_total_entries' is set to true.

  # Exemple of option:
  SortingTableFor::TableBuilder.show_total_entries = true

  # Exemple:
  <% sorting_table_for @users do |table| %>
    <%= table.columns :username, :firstname %>
  <% end %>

  # Ouput:
  <table class='sorting_table_for'>
    <tbody>
      <tr>
        <td colspan='2' class='total-entries'>Total Entries: 42</td>
      </tr>
      <tr>
        <td>...</td>
        <td>...</td>
      </tr>
      ...
    </tbody>
  </table>

 A colspan is added by default with the number of columns.
 Total entries are compatible with the plugin 'will_paginate'.
 The total entries text if defined by I18n translation.

  # I18n translation:
  I18n.t(:total_entries, :scope => :sorting_table_for, :value => total_entries)

 === Values

 the values given to columns can be anything. Only the symbols are the values of the collection.
 If you give other types (string, image, ...) there won't be interpreted.