Search code examples
htmlcurrencymicrodataschema.org

Insert price currency microdata (schema.org) into a html table


I have following piece of code:

<tr><th>Availability:</th>
  <td><link itemprop="availability" href="http://schema.org/InStock"/>available</td></tr>
<tr><th>Price:</th>
  <td itemprop="price">$137</td></tr>
<meta itemprop="priceCurrency" content="USD" />
</tbody>

Unfortunately, it doesn't validate: Start tag meta seen in table.

How can I insert price currency and have validation correct?


Solution

  • You could put the meta element in the td and move the price property to a span (otherwise the price value would include the string "USD").

    <tr>
      <th>Price:</th>
      <td>
        <span itemprop="price">137</span>
        <meta itemprop="priceCurrency" content="USD" />
      </td>
    </tr>