bind data dynamically to p-table(column wise)

Discussão em 'Angular' iniciado por s d, Março 30, 2025.

  1. s d

    s d Guest

    I have a json data like following,and I am trying to present this data in the table format but unable to bind in the expected way. can someone please let me know if we can achieve this with p-table ?

    here is what I am trying, but duplicate records can be seen row wise as let-car is loop thhrough the data.

    stackblitz

    data:

    {
    Year: 2023,
    InputData: {
    OilProduction: 0,
    GasProduction: 0,
    NGLProduction: 0,
    },
    },
    {
    Year: 2024,
    InputData: {
    OilProduction: 1,
    GasProduction: 2,
    NGLProduction: 3,
    },
    },
    ];


    Expected design of the table:

    parameter 2023 2024
    oil production 0 1
    gas production 0 2
    NGL production 0 3

    Continue reading...

Compartilhe esta Página