0

thanks in advance to anyone who helps out. i am working on a web interface for a grading system (sat prep school.) i have the server passing back tests in a JSON object. The JSON object contains the test name along with its sections and questions per section (in other words, the test structure.)

for example a snippet of the JSON for a given test might look like the following:

{"Section 1":[{"subject":"Writing","experimental":"0","manual_assign":"1","columns":"1","number":null,"difficulty":null,"answer":null}],"Section 2":[{"subject":"Critical Reading","experimental":"0","manual_assign":"0","columns":"4","number":"1","difficulty":"Easy","answer":"B"},...

from the JSON object i need to build an HTML form where the questions in a given section are vertically ordered inputs. it should look like the following image: enter image description here

i'm not sure what the best way to do this is. more specifically how do i get columns of inputs vertically ordered like in the image (considering that the number of questions can vary per section based on which test is being graded.) any help is very much appreciated!

gabereal
  • 304
  • 3
  • 11

1 Answers1

1

You might want to look at http://www.alistapart.com/articles/multicolumnlists/. It walks through a lot of different ways to use CSS to flexibly display lists in columns.

Bill
  • 25,119
  • 8
  • 94
  • 125
  • interesting article. thanks for posting. do you think the preferred method in the article is better than inverting a table? i found this [link](http://stackoverflow.com/questions/6297591/how-to-invert-the-rows-and-columns-of-an-html-table). i was just going to make the numbers nested tags (nested in the actual cell) and the neighboring cells tags. are there any reasons to avoid this technique? – gabereal Apr 15 '12 at 02:58
  • Personally I think there is more flexibility in using lists for things like this. Depending on how pedantic you want to be, lists are also more semantically correct in this situation since it really is an ordered list of items. Tables should generally be used when you are displaying tabular data, not for presentation. In the end, I say do whatever you can get working because that's all that really matters :) – Bill Apr 15 '12 at 05:17