Problem mixing divs with table tags

Greetings,
I’m trying to understand why I cannot output embedded ruby content
between div tags:

I have a div which I’m setting from a template and ruby code creating a
table rows:

<% @packing_slip.packing_items.each_with_index do |@item, i| %> <%= (i + 1) %>
<%= text_field "tracking_number", @item.tracking_number %>
<% end %>

When I view the selection source (ff 2.0 is neato!), line_items does
not contain the table rows:

<div id="line_items">

  </div><tr class="altRow">
    <td align="center">1</td>
    <div id="track" style="display: none;">
    <input size="30" name="tracking_number[]" id="tracking_number_"

type=“text”>

    </div>
  </tr>

  <tr class="altRow">
    <td align="center">2</td>
    <div id="track" style="display: none;">
    <input size="30" name="tracking_number[]" id="tracking_number_"

type=“text”>

I thought perhaps it has something to do with embedding the code within
a remote_form_for and changed that to a form_for. Same thing. I know
that using only divs, without table tags, does wrap the field:

<% @packing_slip.packing_items.each_with_index do |@item, i| %>
<%= text_field "tracking_number", @item.tracking_number %>
<% end %>
    <th>Description</th>
    <th>Qty</th>
    <th>Serial # </th>
    <th>Tracking # </th>
  </tr>
<div id="line_items">

    <div style="display: none;" id="track">

    <input size="30" name="tracking_number[]" id="tracking_number_"

type=“text”>

    <div style="display: none;" id="track">
    <input size="30" name="tracking_number[]" id="tracking_number_"

type=“text”>

</div>
Item RMA # Part #

However, I’d rather not sacrifice the table layout at this time. Any
thoughts are greatly appreciated!

Regards,
Dave

<% @packing_slip.packing_items.each_with_index do |@item, i| -%> <%= (i + 1) %>
<%= text_field "tracking_number", @item.tracking_number %>
<% end -%>

there is now reason why this should not work exept that you are trying
to put tr/td’s in a div. It looks like your closing the line_items div
twice

Thanks Keynan. I thought it would be possible to use both together. I
will avoid doing that. -Dave

On Nov 16, 8:31 am, Keynan P. [email protected]