Reputation: 87
I Have a Problem finding way to loop data, I Have Json Data Like This
[
{
"STATUS":"CUTTING INHOUSE",
"STID":"1",
"CATS":[
{
"CAT":"ORIGINALS ",
"ARTS":[
{
"ARTNO":"GY8252",
"QTY":"3.0"
},
{
"ARTNO":"GY8255",
"QTY":"23.0"
}
]
},
{
"CAT":"RUNNING",
"ARTS":[
{
"ARTNO":"GW8588",
"QTY":"3.0"
},
{
"ARTNO":"GW8589",
"QTY":"45.0"
}
]
}
]
},
{
"STATUS":"CUTTING SUBCONT",
"STID":"2",
"CATS":[
{
"CAT":"ORIGINALS ",
"ARTS":[
{
"ARTNO":"GY8252",
"QTY":"46.0"
},
{
"ARTNO":"GY8255",
"QTY":"32.0"
}
]
},
{
"CAT":"RUNNING",
"ARTS":[
{
"ARTNO":"GW8588",
"QTY":"52.0"
},
{
"ARTNO":"GW8589",
"QTY":"52.0"
}
]
}
]
},
]
So I Want to Show it on Table
<tbody v-for="i in repdata" :key="i.STID">
<tr>
<td align="center" class="stephead" colspan="6">{{ i.STATUS }}</td>
</tr>
<tr v-for="j in i.CATS" :key="j.CAT">
<td>ASDSAD</td>
<td>{{ j.CAT }}</td>
<td></td>
<td>3T</td>
<td>3</td>
<td>SMS</td>
</tr>
<tr class="totbycat">
<td colspan="4">Total Qty:</td>
<td>10</td>
<td></td>
</tr>
<tr class="grandtot">
<td colspan="4">Grand Total Cutting :</td>
<td>10</td>
<td></td>
</tr>
</tbody>
The Result from my code is still wrong
I cannot Loop ARTS My Expectation Output is Like
I Have try add div before tr but it doesn't work, as I know we cannot put except in table,
please i have confuse to looking for solution
Upvotes: 1
Views: 155
Reputation: 95
I see 2 fundamental difficulties implementing your request:
computed
property for this purpose.colspan
to show the desired result, but it can be ridiculously complicated. Simply use div
with set width for each cell.Here is a sample implementation in CodePen:
https://codepen.io/mina-tokyo/pen/mdOLxyV
Upvotes: 1