<p>I converted my company's calendar to XSL and changed all the tables to divs. It worked pretty well, but I had a lot of 8 day week bugs to work out initially owing to precarious cross-browser spacing issues. But I was reading another post regarding when to use tables v. divs and the consensus seemed to be that you should only use divs for true divisions between parts of the webpage, and only use tables for tabular data.  </p>

<p>I'm not sure I could even have used tables with XSL but I wanted to follow up that discussion of Divs and Tables with a discussion of the ideal way to make a web calendars and maybe a union of the two. </p>

[{'answer_id': 42179, 'author': 'Neall', 'author_id': 619, 'author_profile': 'https://Stackoverflow.com/users/619', 'pm_score': 3, 'selected': False, 'text': '<p>I would say that a calendar is a table, therefore making the table the proper markup for its representation.</p>\n\n<p>Edit: <a href="http://www.answers.com/table" rel="noreferrer">Definition 11 for "table"</a> from answers.com says:</p>\n\n<blockquote>\n  <p>An orderly arrangement of data, especially one in which the data are arranged in columns and rows in an essentially rectangular form.</p>\n</blockquote>\n'}, {'answer_id': 42181, 'author': 'rp.', 'author_id': 2536, 'author_profile': 'https://Stackoverflow.com/users/2536', 'pm_score': 5, 'selected': False, 'text': '<p>A calendar is the perfect reason to use a table! Calendars inherently present tabular data and HTML tables are good at presenting tabular data. And HTML table markup provides nearly all the CSS hooks you need to associate CSS selectors with various parts of the table to dress it up. </p>\n\n<p>I\'m all for using DIVs for layout--but stick with tables for tabular data. </p>\n\n<p>Here is a cool article on how to dress up tables with CSS:\n<a href="http://www.smashingmagazine.com/2008/08/13/top-10-css-table-designs" rel="noreferrer">http://www.smashingmagazine.com/2008/08/13/top-10-css-table-designs</a></p>\n'}, {'answer_id': 42183, 'author': 'automatic', 'author_id': 3854, 'author_profile': 'https://Stackoverflow.com/users/3854', 'pm_score': 1, 'selected': False, 'text': '<p>Tables are for displaying tabular data.  So I would say <code>&lt;table&gt;</code> is ideal.</p>\n'}, {'answer_id': 42184, 'author': 'John Sheehan', 'author_id': 1786, 'author_profile': 'https://Stackoverflow.com/users/1786', 'pm_score': 2, 'selected': False, 'text': "<p>I think this is definitely a case for using tables. The biggest issue when using divs would be box height for each individual day. If you're styling each box with a border, they could look off if the content for one day is longer than another. The additional markup to make it look right would be more than it would take to create it with a table, so I don't think divs are worth the extra effort in this case.</p>\n"}, {'answer_id': 42198, 'author': 'public static', 'author_id': 1368, 'author_profile': 'https://Stackoverflow.com/users/1368', 'pm_score': 1, 'selected': False, 'text': "<p>It makes sense to use tables, but if you were to look at Google Calender, they seem to be using div tags.  It is possible that using div tags lowers the file size, so in an enterprise environment it might be worth the 'trouble'.</p>\n"}, {'answer_id': 42235, 'author': 'bpapa', 'author_id': 543, 'author_profile': 'https://Stackoverflow.com/users/543', 'pm_score': 1, 'selected': False, 'text': '<p>Do it up in a table. </p>\n\n<p>Also don\'t think of it as "divs vs. tables" Think of it as tables vs. a proper semantic tag with meaning. When I author pages I try to use divs as little as possible, in a lot of cases you could be using a paragraph, a list item, etc.</p>\n'}, {'answer_id': 42509, 'author': 'James A. Rosen', 'author_id': 1190, 'author_profile': 'https://Stackoverflow.com/users/1190', 'pm_score': 1, 'selected': False, 'text': '<p>You might also consider an ordered list (weeks) of ordered lists (days), or simply one ordered list (days).</p>\n\n<p>There are <a href="http://www.cssnewbie.com/list-based-css-calendar/" rel="nofollow noreferrer">others</a> who agree that <a href="http://green-beast.com/experiments/css_list_calendar.php" rel="nofollow noreferrer">the list approach</a> is <a href="http://css-tricks.com/elastic-calendar-styling-with-pure-css/" rel="nofollow noreferrer">a good one</a>.</p>\n\n<p><a href="http://mondaybynoon.com/2006/07/24/calendar-semantics-table-or-list/" rel="nofollow noreferrer">Others prefer tables</a>.</p>\n'}, {'answer_id': 411812, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 1, 'selected': False, 'text': '<p>Just came across this thread after posing the same question elsewhere. While I completely agree a calendar is more of a tabular representation of data, I think there\'s truth in the prolific "it depends" answers. For example, I want to show a floating DIV popup when each day in the calendar is moused over. Using a table, the popup flickers as the cursor moves across the calendar since the popup is only active on the cell border and the day number in the cell itself. Using DIVs, the popup is solid (no flicker) the entire time the cursor mouses over the calendar cell.</p>\n'}]
['https://Stackoverflow.com/questions/42169', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1765/']