The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

JayDS (3) [Avatar] Offline
#1
This is more of a stylistic question, I guess. I've just started using iText to generated some reports, and I need to include a header on each page, and it appears easiest to use a table for the information.

I am wondering if it makes any difference if I do multiple rows in the table or if I do multiple lines within a cell and just have one row. Is it "better" to do it one way or the other? Does it make a difference? I won't be using a border, so that is one thing that doesn't matter.

As I said, I'm new to this, so please point out even the obvious things. Thanks!
blowagie (284) [Avatar] Offline
#2
Re: Question: better if many lines of text in one cell or many rows?
There is no 'better' solution.

I use one cell with several lines when all the lines have the same alignment, so that I can use a single Paragraph. But in practice, this doesn't happen very often. Most of the times my header is only one line, or it's more complicated.

I use different rows when it's more complicated, for instance: the first row spans the complete table width (a cell with colspan 3), the second row consists of 3 cells of which the first one has to be left aligned, the second one centered and the third one right aligned.

I use the 3 cell row very often for headers or footers.
HTH,
Bruno