1

TL;DR: Will you choose tables for phonegap application layout as it provides easy way for resolution independence? Since my html is not going to be parsed by search engines/screen readers, having somewhat incorrect semantic html is ok IMO.

Please don't confuse this question with DIV's vs. Tables or CSS vs. Being Stupid or Why is using DIVs or spans tags "better" than using a table layout? or any other Div vs Table question since this is in phonegap app's context.

I know tables should only be used for tabular data & have gone through numerous articles explaining it. I am wondering specifically in the context of phonegap application, will it be easier to use tables for providing basic structure to the application.

I have created basic application structure using tables & divs. Here's jsfiddle: Layout using Table & Layout using div

Specifically, when I use table, I don't have to worry about calculating height of <tr id="content-area"><td></td></tr>. Browser will calculate its height dynamically depending on "navbar" display. With div's, I have to worry about "content-area"'s height & it also becomes difficult to specify height in percentage when there are other elements in the container of which height is in pixels. e.g. navbar. In this case, browser handles good amount of calculations which otherwise I will have to do in javascript to achieve resolution independence.

Community
  • 1
  • 1
Nilesh
  • 5,955
  • 3
  • 24
  • 34
  • Tis traditional to put `TR;DR` near the *top*, so that it doesn't actually get skipped. :-) – jpaugh Feb 19 '14 at 01:36
  • 1
    Done. I have always used it at bottom but your argument makes sense. :) – Nilesh Feb 19 '14 at 01:42
  • Use things for what they're meant to be used for. Semantics still matter, no matter the context. – Etheryte Feb 19 '14 at 08:38
  • @Nit: I agree with you about semantics & I have been advocating it since long. Here only thing I am trying to see is if we can achieve some benefit by making an exception to the rule. With the tables approach, I don't have to calculate height of content-area everytime. I can not find the way to achieve the same result by using just css. I want to avoid calculating height by using javascript or having lots of media queries to support different resolutions. – Nilesh Feb 19 '14 at 21:26

1 Answers1

0

There are some points you should consider when working with data.

1) If you want you data to always show in fixed columns you should you tables. Meaning if you have four columns they can be compressed but they will always show same way 2) If for eg. you are showing 4 photos in a row and on decreasing the width. You want to slide 2 photos to next rows then you should use divs

for more detail please read this article

skhurams
  • 2,133
  • 7
  • 45
  • 82
  • I am not using tables here for displaying data & using it for providing skeleton to the application. I want to know what will be the downsides of doing so. – Nilesh Feb 19 '14 at 21:41