Je souhaite afficher les données que nous récupérons à partir de fichiers XML et JSON sous la forme d'un tableau, comme le montre cette astuce : https://jsfiddle.net/daksh844/hrw85ck5/
La disposition doit être exactement la même que sur le violon. Je ne parviens pas à obtenir cette mise en page dans un tableau. Merci de partager votre expérience dans les deux cas (XML et JSON).
J'ai essayé de travailler sur ce sujet https://jsfiddle.net/daksh844/jgmw6we4/4/ mais il n'est pas possible d'afficher les données exactement de la même manière.
Les données sont les suivantes :
XML :
<ClientInvestmentInstructionList>
<ClientInvestmentInstruction>
<InstructingOrgName>Sample</InstructingOrgName>
<InstructingOrgCode>A1</InstructingOrgCode>
<PortfolioList>
<Portfolio>
<PortfolioName>Sample A-1</PortfolioName>
<PortfolioCode>Child</PortfolioCode>
<AuthorizeFundList>
<Fund>
<FundName>Sample A-1</FundName>
<FundCode>Sub-child</FundCode>
</Fund>
<Fund>
<FundName>Sample A-1</FundName>
<FundCode>Sub-child 2</FundCode>
</Fund>
</AuthorizeFundList>
</Portfolio>
<Portfolio>
<PortfolioName>Sample A-1</PortfolioName>
<PortfolioCode>Child 2</PortfolioCode>
<AuthorizeFundList>
<Fund>
<FundName>Sample A-1</FundName>
<FundCode>Sub-child 3</FundCode>
</Fund>
<Fund>
<FundName>Sample A-1</FundName>
<FundCode>Sub-child 4</FundCode>
</Fund><Fund>
<FundName>Sample A-1</FundName>
<FundCode>Sub-child 5</FundCode>
</Fund>
</AuthorizeFundList>
</Portfolio>
<Portfolio>
<PortfolioName>Sample A-1</PortfolioName>
<PortfolioCode>Child 3</PortfolioCode>
</Portfolio>
</PortfolioList>
</ClientInvestmentInstruction>
<ClientInvestmentInstruction>
<InstructingOrgName>Sample</InstructingOrgName>
<InstructingOrgCode>A-2</InstructingOrgCode>
<PortfolioList>
<Portfolio>
<PortfolioName>Sample A-2</PortfolioName>
<PortfolioCode>Child</PortfolioCode>
<AuthorizeFundList>
<Fund>
<FundName>Sample A-2</FundName>
<FundCode>Sub-child</FundCode>
</Fund>
<Fund>
<FundName>Sample A-2</FundName>
<FundCode>Sub-child 2</FundCode>
</Fund>
</AuthorizeFundList>
</Portfolio>
<Portfolio>
<PortfolioName>Sample A-2</PortfolioName>
<PortfolioCode>Child 2</PortfolioCode>
<AuthorizeFundList>
<Fund>
<FundName>Sample A-2</FundName>
<FundCode>Sub-child 3</FundCode>
</Fund>
<Fund>
<FundName>Sample A-2</FundName>
<FundCode>Sub-child 4</FundCode>
</Fund>
</AuthorizeFundList>
</Portfolio>
</PortfolioList>
</ClientInvestmentInstruction>
</ClientInvestmentInstructionList>
JSON :
{"ClientInvestmentInstructionList": {
"ClientInvestmentInstruction": [
{
"InstructingOrgName": "Sample",
"InstructingOrgCode": "A1",
"PortfolioList": {
"Portfolio": [
{
"PortfolioName": "Sample A-1",
"PortfolioCode": "Child",
"AuthorizeFundList": {
"Fund": [
{
"FundName": "Sample A-1",
"FundCode": "Sub-child"
},
{
"FundName": "Sample A-1",
"FundCode": "Sub-child 2"
}
]
}
},
{
"PortfolioName": "Sample A-1",
"PortfolioCode": "Child 2",
"AuthorizeFundList": {
"Fund": [
{
"FundName": "Sample A-1",
"FundCode": "Sub-child 3"
},
{
"FundName": "Sample A-1",
"FundCode": "Sub-child 4"
},
{
"FundName": "Sample A-1",
"FundCode": "Sub-child 5"
}
]
}
},
{
"PortfolioName": "Sample A-1",
"PortfolioCode": "Child 3"
}
]
}
},
{
"InstructingOrgName": "Sample",
"InstructingOrgCode": "A-2",
"PortfolioList": {
"Portfolio": [
{
"PortfolioName": "Sample A-2",
"PortfolioCode": "Child",
"AuthorizeFundList": {
"Fund": [
{
"FundName": "Sample A-2",
"FundCode": "Sub-child"
},
{
"FundName": "Sample A-2",
"FundCode": "Sub-child 2"
}
]
}
},
{
"PortfolioName": "Sample A-2",
"PortfolioCode": "Child 2",
"AuthorizeFundList": {
"Fund": [
{
"FundName": "Sample A-2",
"FundCode": "Sub-child 3"
},
{
"FundName": "Sample A-2",
"FundCode": "Sub-child 4"
}
]
}
}
]
}
}
]
}