Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to arrange divs with css as a grid?
    primarykey
    data
    text
    <p>I want to present dynamically generated (PHP, XML) questionnaires to the user in the browser like this: <img src="https://i.stack.imgur.com/csgL9.png" alt="layout draft of questionnaire"></p> <p><strong>requirements:</strong><br> 1. The left column will will always be a number, the middle and the right column may swap position in some questionnaires.<br> 2. There will be questionnaires with 200 items or so over multiple pages.<br> 3. The width of the container (rounded corners) is fixed at 800px at this time, BUT<br> 4. it has to be flexible / fluid in the near future for being displayed on mobile devices like iPad and iPhone</p> <p><strong>what I've tried</strong><br> I experimented both with a <code>&lt;table&gt;</code> based and a <code>&lt;div&gt;</code> based layout:</p> <p>The <code>&lt;table&gt;</code> was clean and simple, but with lots of overhead and not very flexible, e.g. if I swapped middle and right column for item #2 only...</p> <p>The <code>&lt;div&gt;</code> based layout was sleeker, I let the containers float, but have to set the <code>divs</code> to a fixed width in order to get them align in columns. In a fluid design, I do not know the widths in advance, which will be a mess then...</p> <p><strong>questions</strong> to the pros:<br> 1. <code>&lt;table&gt;</code> or <code>&lt;div&gt;</code>, regarding my requirements above, what would you prefer?<br> 2. is there some magic tool to make this nice and easy?<br> 3. would you rather serve the raw data and let a client-side script (jQuery) do the positioning instead?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload