1

I have a page listing multiple events in a table, so I have each one set as its own Event in microdata markup, as below:

<div itemscope itemtype="https://schema.org/Event">
<tr>
    <meta itemprop="name" content="Really Cool Event">
    <td itemprop="location" itemscope itemtype="https://schema.org/Place">
    <a href="#"><span itemprop="name">Hooville</span></a>
         <div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
         <meta itemprop="addressLocality" content="Hootown, USA">
       </div>
    </td>
    <td><span itemprop="startDate" content="2015-12-25">25th</span> - <span itemprop="endDate" content="2015-12-30">30th December 2015</span></td>
    <td itemprop="offers" itemscope itemtype="https://schema.org/Offer" id="price" class="text-success">
        <span itemprop="price" content="1000"><strong>$1000</strong></span>
    </td>
</tr>
</div>

However, Google's Structured Data Tester fails to find the location, startDate and offer for the Event. It finds the Place just fine, but separates it from the Event. It seems to me that they are all nested within the Event div, so what's up?

1

Your table markup is not valid (a div can’t contain a tr, a tr can’t contain a meta).

If you fix it, Google’s testing tool seems to recognize it fine.

A quick way for testing this (but you shouldn’t publish like that): replace the tr and td elements with div.

  • So microdata can't be integrated into a dynamically generated table? – ElendilTheTall Nov 24 '15 at 12:19
  • @ElendilTheTall: It can, but your table markup should be valid. -- (Depending on your table and data, it can get complex to say everything you want with Microdata, so you might need to use itemref sometimes.) – unor Nov 24 '15 at 12:24
  • I have had a play around and now basically the only thing I need to do is give each Event a name, but I want this hidden as it would be redundant to put this in the table. How can I do that and still play ball with Google? – ElendilTheTall Nov 24 '15 at 12:29
  • @ElendilTheTall: Like you do it in your example, with the meta element (there is no definite answer if or if not this is a problem for Google; see my answer). – unor Nov 24 '15 at 13:38
  • but I can't use meta inside tr tags... – ElendilTheTall Nov 24 '15 at 13:41
0

To be validated it should look like:

<div itemscope itemtype="https://schema.org/Event">
<div>
<meta itemprop="name" content="your event's name" >
<link itemprop="url" href="http://www.example.com/your-events-website.html">
    <meta itemprop="name" content="Really Cool Event">
    <div itemprop="location" itemscope itemtype="https://schema.org/Place">
    <a href="#"><span itemprop="name">Hooville</span></a>
         <div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
         <meta itemprop="addressLocality" content="Hootown, USA">
       </div>
    </div>
    <div><span itemprop="startDate" content="2015-12-25">25th</span> - <span itemprop="endDate" content="2015-12-30">30th December 2015</span></div>
    <div itemprop="offers" itemscope itemtype="https://schema.org/Offer" id="price" class="text-success">
    <meta itemprop="name" content="your offer's name" >
    <link itemprop="url" href="http://www.example.com/your-offers-website.html">
        <span itemprop="price" content="1000"><strong>$1000</strong></span>
    </div>
</div>
</div>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.