Hi guys,
I have a question on merging data
1.How to use the colspan to merge the button in column based on the dynamic data?
Here are the image of my data in a table
using colspan
and here the coding for it in javascript:
var DrillStructure = {
"Cutting" : {
"dDom" : "<th>No</th><th>Part Name</th><th>Raw Material</th><th>Order Qty</th><th>Qty</th><th>Marker 's Size</th><th>Req Hrs</th><th>Cutting Start</th><th>Cutting End</th><th>Status</th></tr></thead>",
"link" : "msp/loopForCutting"
},
"Printing" : {
"dDom" : "<th>No</th><th>Part Name</th><th>Order Qty</th><th>Qty</th><th>Colour Print</th><th>Type</th><th>No of Up</th><th>Req Hrs</th><th>Printing Start</th><th>Printing End</th><th>Status</th><th >Action</th></tr></thead>",
"link" : "msp/loopForCutting"
}
};
and this is the php code:
$iloop = 1;
foreach ($rResult->result_array() as $aRow) {
if($department == 'Printing') {
$material = $aRow['material_part'];
$qty = $aRow['qty'];
$demand = $aRow['UPH'];
$colprint = $aRow['colprint'];
$noup = $aRow['noup'];
$reqhrs = ((($colprint * $qty) / $demand) / $noup);
$btn = "<a class='btn' data-mat = \"{$material}\" onclick=\"openPrintingLog(this, 'prnlog','{$iloop}', '{$idschedule}')\"></a>";
$row[0] = $btn;
$row[1] = $material;
$row[2] = $aRow['qty'];
$row[3] = $aRow['prnqty'];
$row[4] = $aRow['colprint'];
$row[5] = $aRow['coltype'];
$row[6] = $aRow['noup'];
$row[7] = number_format($reqhrs,2,'.','');
$row[8] = "<span class='editable' data-from='part' data-field='printingstart' data-id='{$aRow['idschedulepart']}'>{$aRow['printingstart']}</span>";
$row[9] = "<span class='editable' data-from='part' data-field='printingend' data-id='{$aRow['idschedulepart']}'>{$aRow['printingend']}</span>";
$row[10] = $aRow['status'];
$row[11] = "<a class='btn btn-small' onclick='open_wrappers();'>Complete</a>";
}
$iloop = $iloop + 1;
$output['aaData'][] = $row;
}
Thank in advance.
What I have tried:
I have searching for how to using colspan and rowspan,and found this page but don't know how it works.
Merging