Click here to Skip to main content
13,198,322 members (66,348 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Well, I don't really know where to start...

I want to create a table with editable data (I have this data and it's input mechanism) in a pdf format for easier printing rather than creating an html document and converting it to a pdf format (due to its free flowing nature, if data inputted is too long, certain images are pushed to another page which is a problem for printing).

Seeing as fpdf does not have table support, do I need to just create a template using lines and then fill in the details? If so how?

Thanks for reading this!


Edit: for some reason whenever I draw a line, it requires a line of text (I'm using $msg) before it otherwise it does not show up. Help?
Posted 13-Jun-12 22:47pm
Updated 3-Apr-17 3:56am
Madbull12 14-Jun-12 6:58am
Sorry, realised I was being stupid and forgetting to use specific code for fpdf :S
worked it out :D
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

OP commented that he solved the issue. Posting here just to pop it out of Unanswered list.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Making tables using FPDF for a pdf document is a common problem. Have a look at the easyTable project: GitHub - fpdf-easytable/fpdf-easytable: fpdf-easyTable is a PHP class that makes it easy to build tables for PDF documents generated with the FPDF library[^]

It is very easy to use:
$table=new easyTable($pdf, 3, 'border:1;');
// first row
$table->easyCell('Text 1', 'valign:T'); 
$table->easyCell('Text 2', 'bgcolor:#b3ccff;');
$table->easyCell('Text 3');
//second row
$table->rowStyle('min-height:20; align:{C}'); 
$table->easyCell('Text 4', 'colspan:3');

I hope my answer can help somebody.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web03 | 2.8.171020.1 | Last Updated 3 Apr 2017
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100