There are several ways to create a layout with multiple rows and columns.
Manually add the code
You can rows and columns to your cart layout by editing your layout’s code:
Go to Content > Cart Layout.
Create a new cart layout or edit an existing one.
Insert the following code into the Edit the Cart Layout textbox:
Add a value for the number of columns you want in your layout at the top.
{% set num_cols = 3 %}
Modify the For loop by adding the following just before the final statement:
{% if loop.index%num_cols == 0 and loop.index != products|length %}
</tr>
<tr>
{% endif %}Select Save.
Example
Your code should look like this:
{% set num_cols = 3 %}
<table>
<tr>
{% for product in products %}
<td>
(Product details here, or in multiple table cells)
</td>
{% if loop.index%num_cols == 0 and loop.index != products|length %}
</tr>
<tr>
{% endif %}
{% endfor %}
</tr>
</table>
Jinja Batch filter
Another way to do this is to use Jinja's Batch filter, which can create code like this:
Learn more with Jinja’s documentation.
{% set max_products_to_show = 10 %}
{% set cols = 2 %}
{# set cols to the number of columns you want #}
{% if products|length > 0 %}
<table style="border-collapse: collapse; color: #444;" cellpadding="5">
{% for prod_row in products|limit(max_products_to_show)|batch(cols) %}
<tr>
{% for product in prod_row %}
<td><a href="{{ product.u }}"><img border="0" src="{{ product.img }}" width="100"/></a><br>
{{ product.n }}</td>
{% endfor %}
</tr>
{% endfor %}
</table>
{% endif %}
Go to Content > Cart Layout.
Create a new cart layout or edit and existing one.
Use Jinja Batch filter to create the appropriate code.
As in the example above.
Copy and paste the code into the Edit the Cart Layout textbox.
Select Save.