0

I'm currently using the jquery plug in Datatables, to create a top 3 table per the car industry.

My first row, I have a title Car Sales Under that row I'd like to have 3 more columns that says: Highest Revenue, Second Highest Revenue, Third Highest Revenue under each of this sections I am attempting to add two values per one column. For example, in my Highest Revenue column; I would like it to have the title, and amount under the one column like Walk ins 2002.

I am unable to create this in Datatables as it creates a new column for every entry. Is there a way to link the two and have 2 sets of values under one column?

Here is an example of my expected outcome:


+-----------------+---------------------+------------------------+-----------------------+
|                 |                     |                        |                       |
| Car Industry    |   HIGHEST REVENUE   |  2ND HIGHEST REVENUE   |  3RD HIGHEST REVENUE  |
+----------------------------------------------------------------------------------------+
|                 |                     |                        |                       |
|Car Sales        | Walk Ins 2002       | Appointments 764       |  Online 304           |
|                 |                     |                        |                       |
+-----------------+---------------------+------------------------+-----------------------+

Here is a link to my jsfiddle

maimok
  • 333
  • 1
  • 3
  • 12
  • Does this answer your question? [Datatables - Merge columns together](https://stackoverflow.com/questions/19777075/datatables-merge-columns-together). In particular, look at the answer for DataTables version 1.10, which uses a `render` function to combine 2 values into one cell. – andrewJames Jul 17 '20 at 00:20
  • Additional information & examples for renderers can be found in the DataTables [manual](https://datatables.net/manual/data/renderers). – andrewJames Jul 17 '20 at 00:26

0 Answers0