Is there any way I can get the column number or position and the row header of the table using vue?
Output now so far is like this.
Code in generating the table:
<table v-if="this.itemList.length > 0">
<thead class="ui-table-header-row">
<tr>
<th class="ui-table-header-cell l-padding"></th>
<th class="ui-table-header-cell center" v-for="item in 31" :key="item.id">{{thisMonth}} July{{ item }}Day</th>
</tr>
</thead>
<template>
<tr>
<td></td>
</tr>
<tbody style="border-bottom:#dbb100 1px" v-for="(item,index) in itemList" :key="index.id" >
<tr class="left-align">
<td>{{item.name}}</td>
<td v-for="(item,index) in costList" :key="index.id">{{item.total_work}}</td>
</tr>
</tbody>
</template>
</table>
On this line <td v-for="(item,index) in costList" :key="index.id">{{item.total_work}}</td>
, I would have to check first the row header name if it matches with my item.name
in costList
before displaying the value. I have found somewhat near to my desired output here but I don't know how to reproduce it using vue. Any inputs is appreciated.