so far this is what i’ve managed to do, but i don’t know how to render the array “righe”, if you put the json code into http://json2table.com/ then you have an idea how the table should look like.
Wow this is amazing and it works fine, do you think i can youse this funcion also for other json as well? Or is specifically thought just for table layout? Many many thanks for your help
Vincenzo Vecchio
ASKER
If i can ask also, this code uses the json key as header for the table, is it by any chance possible to change them?
Julian Hansen
This will work on any JavaScript object (with arrays of objects)
Header - you can change them but then you have to customise the solution or the JSON structure to include headers
Or
If you only want headers on the main table you could pass an array of header values to the table function
Or
You could pass a nested structure of header values into the table function and on each recursive call the createTable function is called with the next layer of headers (if one exists)
do you think i can youse this funcion also for other json as well
Not sure what you mean?
You can use other JSON to create a table - what else did you want to do with it?
Vincenzo Vecchio
ASKER
Hi Julian sorry i couldn't answer earlier. Yes sorry that was a stupid question. If yu don't mind I would also ask you another question, at the moment I'm doing a request to a php file where the start date and and date are set as constant, now I would like to use a form where i can select start date and end date and then pass these to the php file. I've tried with a ajax call but it still does load the json into the form action url wich is my php file. Do you know why? Many thanks
Julian Hansen
I would need to see code - but best to open another question and post link here.