$col3r->setalignment("right"); $col3h->setalignment("right"); /* Make an instance of the table class */ $table = new jh_pdf_table(&$pdf, &$ypos, 30, 812, 30); /* Set a function that will be called if a new page is necessary */ $table->setnewpagefunction(newpage); /* Define the columns; the first column has "*" as its width which tells the class to use the remaining width for this column; the addcolumn() method returns a handle so you can adjust the column's parameters */ $col1 =& $table->addcolumn("License", "*", &$col1h, &$col1r); $col2 =& $table->addcolumn("Branches", 100, &$col2h, &$col2r); $col3 =& $table->addcolumn("Percentage", 100, &$col3h, &$col3r); $col4 =& $table->addcolumn("Barcode", 100, &$col4h, &$col4r); /* Adjust some table parameters */ $table->setverttableborderwidth(1); $table->setverttablebordercolor(0); $table->setcolspacingwidth(1); $table->setcolspacingcolor(0); $table->setrowspacingwidth(1); $table->setrowspacingcolor(0); $table->setheaderbgcolor(0.85); $table->setbgcolors(array(false, 0.95)); /* Adjust the bgcolor of the barcode cell to to white, because some barcode readers might get into trouble otherweise */ $col4->normcellparam->bgcolor = 1; /* Adjust the cell padding on the left and the right side of the barcode column, so that the table lines don't interfere with the barcode */ $col4->normcellparam->leftpadding = 10; $col4->normcellparam->rightpadding = 10;