Project

General

Profile

Defect #585

Tables spanning several pages starts to break apart...

Added by Joe Privett over 10 years ago. Updated almost 8 years ago.

Status:
Closed
Priority:
High
Assignee:
Target version:
-
Start date:
01/15/2014
Due date:
% Done:

0%

Estimated time:

Description

I have generated a PDF (attached) containing a table using the code below. Problem is that after the table crosses a few pages, it starts to break-up - do you know why?

$num_columns = 4;
$table = new tfpdfTable($pdf_report);
$table->initialize(array(70,90,55,55), $table_2_config);

$row = array();
$row[0]['TEXT'] = stripslashes($row_cat['ra_hazard_category']);
$row[0]['TEXT_COLOR'] = array(255,255,255);
$row[0]['TEXT_SIZE'] = 14;
$row[0]['LINE_SIZE'] = 6;
$row[0]['BACKGROUND_COLOR'] = array(53,53,53);
$row[0]['COLSPAN'] = 4;
$table->addRow($row);

$row = array();
$row[0]['TEXT'] = "Hazard";
$row[0]['TEXT_TYPE'] = 'B';
$row[0]['BACKGROUND_COLOR'] = array(241,241,241);
$row[1]['TEXT'] = "Existing Control Measure(s)";
$row[1]['BACKGROUND_COLOR'] = array(241,241,241);
$row[1]['TEXT_TYPE'] = 'B';
$row[2]['TEXT'] = "Category of Harm";
$row[2]['BACKGROUND_COLOR'] = array(241,241,241);
$row[2]['TEXT_TYPE'] = 'B';
$row[3]['TEXT'] = "Likelihood of Harm";
$row[3]['BACKGROUND_COLOR'] = array(241,241,241);
$row[3]['TEXT_TYPE'] = 'B';
$table->addRow($row);

for($h=0;$h <count($haz_title_array);$h++){

$row = array();
$row[0]['TEXT'] = $haz_title_array[$h];
$row[1]['TEXT'] = $ecm_text_array[$h]; 
$row[2]['TEXT'] = $ra_harm_category_array[$h]; 
$row[3]['TEXT'] = $ra_harm_likelihood_title_array[$h]; 
$table->addRow($row);

}

$table->close();


Files

doc.4-21.pdf View doc.4-21.pdf 177 KB Joe Privett, 01/15/2014 02:49 PM

Also available in: Atom PDF