<table>
    <colgroup>
        <col width="18px">
        <col width="calc(40% - 18px)">
        <col width="20%">
        <col width="20%">
        <col width="20%">
    </colgroup>
    <thead>
        <tr>
            <th></th>
            <th>전송시각</th>
            <th>수집건수</th>
            <th>전송건수</th>
            <th>수집-전송 차이</th>
        </tr>
    </thead>
    <tbody></tbody>
    <tfoot></tfoot>
</table>


<script>

    const endPoint = "getPeriodSndMolitTraffStatistics";

    function callBack(data) {
        if (data && data.length) {
            let rcvCntTot = 0;
            let sndCntTot = 0;
            let sndGapCntTot = 0;
            data.forEach((obj)=>{
                rcvCntTot += obj.rcvCnt;
                sndCntTot += obj.sndCnt;
                sndGapCntTot += obj.sndGap;
            });
            return `<tr>
                         <td></td>
                         <td>합계</td>
                         <td>${rcvCntTot.toLocaleString()}</td>
                         <td>${sndCntTot.toLocaleString()}</td>
                         <td>${sndGapCntTot.toLocaleString()}</td>
                    </tr>`;
        }
    }

    function getTableRow(obj, idx) {
        return `<tr onclick="rowClick(this, 'container-2 table tbody')" >
                    <td><input style="display: none" type="checkbox" id="check_${idx}" onchange="checkEvent(this, 'container-2 table tbody')"></td>
                    <td>${obj.logDate}</td>
                    <td>${obj.rcvCnt.toLocaleString()}</td>
                    <td>${obj.sndCnt.toLocaleString()}</td>
                    <td>${obj.sndGap.toLocaleString()}</td>
                </tr>`;
    }

</script>