How to embed HTML because I cannot figure out how to nest a table
How to embed HTML because I cannot figure out how to nest a table
mcraig
Posts: 20Questions: 2Answers: 0
So happy I got direct json data working with my DT object. However, I'm using DT to display a table of some user settings from a database and one of the requirements is that a single setting may house multiple values as an array of arrays or an array of struct...and got forbid, technically there could be some depth to this. Think of it this way, imagine my settings table contains a record called "userpermissions" (that's my first column of output data, the name of the setting, and it's value is stored as a string that is a json object (data). The client wants to store it like that and it's not a searchable "thing" so there's not a big problem with that.
However, the "magic" I was hoping for is that if a settings value with NOT a single value (a data structure of values), is that the output would create nested rows/columns..which would be sweet. But, fiddling, I see that's not going to work out. So, initially I had the thought that before I send the json data from my parent language to the javascript, I'd massage it a bit and convert those "subvalues" into a cute little CSS-pretty table to nest in the cell...but I don't think I can (and definitely don't know how to) do that.
So, unless someone has a brilliant cure for me on all this...my question is: can you embed HTML into a cell (a small table, a div with content, bolded values)?
Thanks, Mike
However, the "magic" I was hoping for is that if a settings value with NOT a single value (a data structure of values), is that the output would create nested rows/columns..which would be sweet. But, fiddling, I see that's not going to work out. So, initially I had the thought that before I send the json data from my parent language to the javascript, I'd massage it a bit and convert those "subvalues" into a cute little CSS-pretty table to nest in the cell...but I don't think I can (and definitely don't know how to) do that.
So, unless someone has a brilliant cure for me on all this...my question is: can you embed HTML into a cell (a small table, a div with content, bolded values)?
Thanks, Mike
This discussion has been closed.
Replies
yup - sorry - DataTables doesn't really do automatic nesting at the moment.
> can you embed HTML into a cell (a small table, a div with content, bolded values)?
Absolutely. Shove whatever HTML you want into a cell :-)
Allan