JSFiddle - React, Tailwind, and code Playground

by Dmitri Ganenco

HTML

<table id="tab"> 
  <thead class="thead-light">
    <tr>
      <th>MobileNumber</th>
      <th>Amount</th>
      <th>Fuel</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>1223445</td>
      <td>12.49</td>
      <td>1223</td>
    </tr>
    <tr>
      <td>99999</td>
      <td>11.39</td>
      <td>1277745</td>
    </tr>
  </tbody>
</table>

JavaScript

/* $('.table tbody tr').reduce((acc, current) => {
	debugger;
}, []); */

const rows = $('#tab tbody tr');

console.log(rows);

rows.reduce((acc,c) => {
	let obj = Object.create({Customer: {}, TemplateFieds: []});
	const firstTD = $(c).find('td').first();
	obj[Customer][firstTD] = 
}, []);