<table>
  <thead>
    <tr>
      <% @table.columns.each do |column| %>
        <th><%= column %></th>
      <% end %>
    </tr>
  </thead>
  <tbody>
    <% @records.each do |record| %>
      <tr>
        <% record.each do |key, value| %>
          <% type = @schema[key][:db_type] %>

          <% if type == 'text' %>
            <td>
              <textarea style="max-width: 200px"><%= CGI.escapeHTML(value.to_s) %></textarea>
            </td>
          <% elsif type.match /integer|numeric/ %>
            <td>
              <input value="<%= CGI.escapeHTML(value.to_s) %>" style="max-width: 300px; text-align: right">
            </td>
          <% else %>
            <td>
              <input value="<%= CGI.escapeHTML(value.to_s) %>" style="max-width: 300px">
            </td>
          <% end %>
        <% end %>
      </tr>
    <% end %>
  </tbody>
</table>

<table>
  <thead>
    <tr>
      <% @table.columns.each do |column| %>
        <th><%= column %></th>
      <% end %>
    </tr>
  </thead>
  <tbody>
    <% @records.each do |record| %>
      <tr>
        <% record.each do |key, value| %>
          <% type = @schema[key][:db_type] %>

          <% if type.match /text|hstore/ %>
            <td>
              <textarea style="max-width: 200px"><%= CGI.escapeHTML(value.to_s) %></textarea>
            </td>
          <% elsif type.match /integer|numeric/ %>
            <td>
              <input value="<%= CGI.escapeHTML(value.to_s) %>" style="max-width: 300px; text-align: right">
            </td>
          <% else %>
            <td>
              <input value="<%= CGI.escapeHTML(value.to_s) %>" style="max-width: 300px">
            </td>
          <% end %>
        <% end %>
      </tr>
    <% end %>
  </tbody>
</table>

Use textareas for `hstore` columns
Use textareas for `hstore` columns
