This is not another general question such as "table versus div for general layout", for example the question why not use tables for layout " .
I am working on a schedule / calendar project, and I always assumed that the calendar would be an example of when to use the usage table. Although after a quick look at the Google Calendar structure, it seems that it consists of a table containing a <td> for each column and inside each column, the event is a <div> with an internal list of definitions.
Why is it profitable?
My own ideas:
- Tables can be more complex for style, beautifully and compactly, when several events of different lengths occur simultaneously (starting from the same
<td> ). The possibility of unwanted spaces. - It is more difficult to update tables when the user adds an event after the page loads, for example. with JavaScript (because the row / colspan of the table headers may change)
- If tables were used, the width of the coincidences along the x-axis and the top headers and cells, as well as the height of the headers and cells of the y-axis, will be automatically matched. It is impossible to manage this without tables.
Is there any of this? Should tabular data always be stored in real tables?
The following is a simplified example of a Google Calendar column:
<td> <div> <dl> <dt>START TIME β END TIME </dt> <dd>EVENT TITLE</dd> </dl> </div> </td>
The following is a complete example:
<td class="tg-col"> <div id="tgCol0" class="tg-col-eventwrapper" style="height:1008px;margin-bottom:-1008px;"> <div class="tg-gutter"> <div class="ca-evp130 chip " style="top:588px;left:-1px;width:100%;"> <dl class="cbrd" style="height:35px;border-color:#9FC6E7;background-color:#E4EFF8;color:#777777;"> <dt style="background-color:;">START TIME β END TIME <i class="cic cic-dm cic-rcr" title="Recurring event"> </i></dt> <dd><span class="evt-lk ca-elp130">EVENT TITLE</span></dd> <div> <div class="mask mask-top" style="border-color:#9FC6E7;background-color:#E4EFF8;"> </div> <div class="mask mask-bottom" style="border-color:#9FC6E7;background-color:#E4EFF8;"> </div> <div class="mask mask-left" style="height:38px;border-color:#9FC6E7;background-color:#E4EFF8;"> </div> <div class="mask mask-right" style="height:38px;border-color:#9FC6E7;background-color:#E4EFF8;"> </div> </div> <div class="resizer"> <div class="rszr-icon"> </div> </div> </dl> </div> </div> </div> <div id="tgOver0" class="tg-col-overlaywrapper"></div> </td>
Edit:
Remember to indicate why Google Calendar is structured as it is, for example. Why is there a table in Google Calendar, but use it only for columns?
Adam lynch
source share