I'm aligning a list, I've managed to align the center with the <td>
, but the <th>
are rebellious, I leave my code:
<h1>Productos Disponibles</h1>
<table style="width:90%" border="1">
<thead>
<tr>
<th> <h4><%= "Nombre" %></h4></th>
<th> <h4><%= "Descripcion" %></h4></th>
<th align="center" ><h4><%= "Existencia" %></h4></th>
<th align="right" > <h4><%= "Precio" %></h4></th>
</tr>
</thead>
<tbody>
<% @productos.each do |producto| %>
<tr>
<td> <h4><%= producto.nombre %></h4></td>
<td> <h4><%= producto.descripcion %></h4></td>
<td align="center" ><h4><%= producto.cantidad_existencia %></h4></td>
<td align="right" > <h4><%= producto.precio %></h4></td>
</tr>
<% end %>
</tbody>
</table>
a sample of the output: