este seria el arreglo completo.....
Código PHP:
$saldoInicial = 5000;
$data = array(
array("Concepto","Enero","Febrero","Marzo","Abril"),
array("Ingresos", 100, 100, 100, 100),
array("Egresos", 200, 200, 200, 200),
array("Deudores", 300, 300, 300, 300),
);
$aa = array("Saldo",($data[1][1]-$data[2][1]),($data[1][2]-$data[2][2]),($data[1][3]-$data[2][3]),$data[1][4]-$data[2][4]);
$bb = array("Saldo Acumulado",($saldoInicial)+($data[1][1])-$data[2][1],
($data[5][1] + $data[1][2]) - $data[2][2] ,
($data[5][2] + $data[1][3]) - $data[2][3],
($data[5][3] + $data[1][4]) - $data[2][4]
);
array_push($data,$aa,$bb);
$tblCuatrimestre1 = '<table width="100%" border="0" cellspacing="0" cellpadding="0">';
foreach($data as $dat){
$tblCuatrimestre1 .= ' <tr>
<td width="20%">'.$dat[0].'</td>
<td width="20%">'.$dat[1].'</td>
<td width="20%">'.$dat[2].'</td>
<td width="20%">'.$dat[3].'</td>
<td width="20%">'.$dat[4].'</td>
<td width="20%">'.$dat[5].'</td>
</tr>';
}
$tblCuatrimestre1 .= '</table>';
echo $tblCuatrimestre1;