Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML

Converting HTML Table into DIVs?

Hi Everyone,

Is it possible to convert html table into divs?

For example, the below syntax, would would it look like in all divs?

<center>
<div itemscope itemtype="http://schema.org/AutoDealer">
<table id='message' border='1'>
<thead>
<tr> 
<th>Dealership</th> <th>Address</th> <th>State</th> <th>City</th> <th>Zip</th>    <th>Phone</th> <th>Website</th> 
</tr>
</thead>
<tbody>
    <tr>

        <td><strong><span itemprop="name">Name</span></strong></td>
        <div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
        <td><span itemprop="streetAddress">Address</span></td>
        <td><span itemprop="addressRegion">State</span></td>
        <td><span itemprop="addressLocality">City</span></td>
        <td><span itemprop="postalCode">12345</span></td>
        <td><span itemprop="telephone">123456789</span></td>
        </div>
        <td><span><a itemprop="url" href="http://website.com" target="_blank">Click Here</a></span></td>
    </tr>


</tbody>
</table>
</div>
</center>

2 Answers

Hi Alex,

I would want to because I'm finding it extremely difficult to add schema microdata markup to my webpages within a table. If you run the above syntax in the google Structured Data Testing Tool you'll find the bellow errors

Error: Page contains property "streetaddress" which is not part of the schema.
Error: Page contains property "addressregion" which is not part of the schema.
Error: Page contains property "addresslocality" which is not part of the schema.
Error: Page contains property "postalcode" which is not part of the schema.

http://www.google.com/webmasters/tools/richsnippets

Thanks

Tables should only be used for data that fits into a spreadsheet style format, which your data certainly does. When people talk about how using tables is bad, they are talking about how a lot of web design used to use tables for layout.

James,

Please read my response to Alex statement. My main concern is schema markup microdata. Working with tables and schema data can be a pain in the butt. I also read somewhere tables and responsive design can be difficult as well. James, what do you think I should do. Give me your thoughts.

Thanks