Problems Adding HTML Tables in Magento Commerce

If you’ve ever tried to add standard html into product descriptions or category descriptions in Magento, you’ll probably come up with a really long page with the table data spread out from top to bottom.

Here’s the solution we found:

This code comes from one of our websites, Summit Equipment, selling truck equipment. This particular product is a Warn DC2000 Electric Hoist. When adding the specs, we used this html table code: (This is a much shortened version here).

<tr>

<td><table width=”100%”>

<tr height=18px>

<td><b>Maximum Rated Load:&nbsp;</b>2000 lbs (907kg)</td>

</tr>

<tr height=18px>

<td><b>Maximum Wire Rope Recommended:&nbsp;</b>1/4″ 7000 lbs (3182kg) minimum breaking strength</td>

</tr>

It turns out, Magento does not like linebreaks. So, remove all your linebreaks, so now you have this spaghetti code:

<tr> <td><table width=”100%”><tr height=18px> <td><b>Maximum Rated Load:&nbsp;</b>2000 lbs (907kg)</td> </tr> <tr height=18px> <td><b>Maximum Wire Rope Recommended:&nbsp;</b>1/4″ 7000 lbs (3182kg) minimum breaking strength</td> </tr>

There you go. Your html table in Magento now displays properly!

You must be logged in to post a comment.