you can use this code to solve this problem... here the concept is only if string size greater than your cell width then font size will reduce.
$pdf->CellFit($table_head2[7],$table_height,$item['remark'],1,0,'C',0,'',1,0);
check this URL
how to auto adjust cell width in fpdf using php and mysql