PdfPTable Can we add multiple tables one after a another with a IF statement based on the value?
<p>I am having issues with PDFtable and multiple tables. It draws the first two tables fine but not any more than two. I need it to work with as many tables as possibles. Has anyone had this requirement before?    </p>

<pre><code>string firstN="";
string firstage="";
string firstNV= someValue;
int firstAgeV=110;
string firstNHobbie = someHobby;

string secondN="";
string secondage="";
string secondNV= someValue2
int secondAgeV=130;
string secondNHobbie = someHobby2;


//If value is not nothing i.e. has a value
if(firstN != "")
 PdfPTable mTablePerson1= new PdfPTable(5);
 mTablePerson1.WidthPercentage = 110f;
 mTablePerson1.AddCell("Name");
 mTablePerson1.AddCell("Age");
 mTablePerson1.AddCell(firstNV);
 mTablePerson1.AddCell(firstAgeV);

//if selected hobbies
PdfPTable mTablePerson1Hobbies = new PdfPTable(5);
mTablePerson1Hobbies.WidthPercentage = 110f;
mTablePerson1Hobbies.AddCell("Hobby");
mTablePerson1Hobbies.AddCell("firstNHobbie");

document.Add(mTablePerson1);
document.Add(mTablePerson1Hobbies);

}else if(secondN != "")
 PdfPTable mTablePerson2 = new PdfPTable(5);
 mTablePerson2.WidthPercentage = 110f;
 mTablePerson2.AddCell("Name");
 mTablePerson2.AddCell("Age");
 mTablePerson2.AddCell(secondNV);
 mTablePerson2.AddCell(secondAgeV);

//if selected hobbies
PdfPTable mTablePerson2Hobbies = new PdfPTable(5);
mTablePerson1Hobbies.WidthPercentage = 110f;
mTablePerson1Hobbies.AddCell("Hobby");
mTablePerson1Hobbies.AddCell("secondNHobbie");

document.Add(mTablePerson2);
document.Add(mTablePerson2Hobbies);

}
</code></pre>

<p>For some reason this design hides the second person's tables i.e. mTablePerson2 and mTablePerson2Hobbies. How do I make all the tables added if the firstN and secondN criteria are satisfied? </p>