How do you layout a table cell, and how do I prevent illegal characters.
How do you layout a table cell, and how do I prevent illegal characters.
Sorry for this newbie question, but I've been trying hard the last few days to get my head around how to use DataTables, and I can't seem to understand the way it works.
I can successfully pull data out of my database and hand it over to the DataTables page through JSON, and my table shows the data fine.
But what I do not understand is how does one lay out the table ?
My JSON string is i.e. :
[code]
{ aaData:[ ['name1', 'url1', 'something1'] , ['name2', 'url2', 'something2'] ] }
[/code]
How can I lay out my table cells like this :
[code]
name[]
something1
[/code]
is this even possible, or do I need to put my complete html formatting inside the JSON string ?
ifso, how do I go about avoiding illegal characters that could break my JSON string ?
So far I've tried putting everything in cdata tags, but this results in a bad JSON string, and also running my string through the PHP JSON encode function breaks my string.
What is the recommended way to do this ?
Sorry if this question is below standard, but I couldn't find any example like this, maybe it's just not possible ?
I can successfully pull data out of my database and hand it over to the DataTables page through JSON, and my table shows the data fine.
But what I do not understand is how does one lay out the table ?
My JSON string is i.e. :
[code]
{ aaData:[ ['name1', 'url1', 'something1'] , ['name2', 'url2', 'something2'] ] }
[/code]
How can I lay out my table cells like this :
[code]
name[]
something1
[/code]
is this even possible, or do I need to put my complete html formatting inside the JSON string ?
ifso, how do I go about avoiding illegal characters that could break my JSON string ?
So far I've tried putting everything in cdata tags, but this results in a bad JSON string, and also running my string through the PHP JSON encode function breaks my string.
What is the recommended way to do this ?
Sorry if this question is below standard, but I couldn't find any example like this, maybe it's just not possible ?
This discussion has been closed.