1

I have a JSON response like this:

data = [{
    ProteinID: "2334",
    Feature: "GVN",
    Count: 1
  },
  {
    ProteinID: "2334",
    Feature: "LPA",
    Count: 3
  },
  {
    ProteinID: "2334",
    Feature: "EEG",
    Count: 2
  },
  {
    ProteinID: "2334",
    Feature: "VEP",
    Count: 3
  },
  {
    ProteinID: "2334",
    Feature: "AEM",
    Count: 2
  },
  {
    ProteinID: "28731",
    Feature: "GVN",
    Count: 3
  },
  {
    ProteinID: "28731",
    Feature: "LPA",
    Count: 3
  },
  {
    ProteinID: "28731",
    Feature: "VEP",
    Count: 3
  },
  {
    ProteinID: "1234",
    Feature: "VEP",
    Count: 3
  },
   {
    ProteinID: "1234",
    Feature: "MOB",
    Count: 3
  }
]

The above data is based the Feature column inner join. I need to create the table in html format like. I retrive the data from database. so the column will be change

Expected output look like

ProtienID GVN  LPV  EEG VEP AEM  MOB

2334       1    3   2   3   2    -
28731      3    3   -   3   -    -
1234       -    -   -   3   -    3

note: column name will be dynamically change

vadivel a
  • 1,754
  • 1
  • 8
  • 18
Dev
  • 387
  • 1
  • 12
  • **So?** what you tried so far? what's the **problem** ? | `I need to create` so create *!* – Pedram Feb 09 '20 at 13:27
  • i need create the table format look like 2nd code – Dev Feb 09 '20 at 13:31
  • i tried to change the data format but i'm not familiar in Jquery so that only i asked – Dev Feb 09 '20 at 13:36
  • Take a look [How to create HTML table based on JSON](https://stackoverflow.com/questions/42558090/how-to-create-html-table-based-on-json) – Pedram Feb 09 '20 at 13:43

0 Answers0