3

I'm using jQuery DataTables and trying to create a table with a first column that has headers as rows and a second column with the data, something like this:

-----------------
name    | tom
-----------------
surname | smith
-----------------
age     | 18
-----------------

The data is retrieved with sAjaxSource from a JSON Array. How can I tell to jQuery DataTables that the data is vertical disposed?

And is it possible to dynamically change the alignment of the headers from vertical to horizontal? There are tables that have headers horizontally disposed and some that have vertical disposed like in the example.

innerseal
  • 50
  • 6
pashura
  • 41
  • 1
  • "_How can i tell to datatable that the data are vertical disposed?_" You cant. dataTables strictly follow legal HTML rules, it will not be able to initialize. And with a setup like this I doubt you need a dataTable in the first place. The number of rows would be very limited, no rational need for sorting and so on. Why not build a yourself like in these examples -> http://stackoverflow.com/questions/6368061/most-common-way-of-writing-a-html-table-with-vertical-headers??
    – davidkonrad Mar 25 '14 at 18:54
  • that it's an example, the table will have a lot of data and rows but i want the header in the left side of the table vertical aligned just like the link you posted(it helped), the problem is that datatable don't understand the vertical alignment and put the data under my headers and not in the others column in vertical – pashura Mar 26 '14 at 09:56

0 Answers0