Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am trying to create a table that looks like this using longtable. The table will have many rows so that it spans several pages.

What I'm looking for is how to create this table so that the text in the first column ('Header 1') is left-center justified in the cell and the text the second column ('Header 2') is upper left justified.

I am able to make it work by manually setting the rowcount in multirow, but since the text will change row by row, manually setting the rowcount is not efficient. I need a generic solution that will reflow appropriately.

Sorry for the poor graphic, but due to site rules, I can't post a screenshot.

--------------------------------------------------------------
|header 1      |header 2       |header 3       |header 4     |
---------------|---------------|---------------|-------------|
|              |This is where  |               |             |
|              |some text will |               |             |
|              |go that spans  |               |             |
|This is where |several rows.  |               |             |
|a lot of text |---------------|---------------|             |
|will go that  |This is where  |               |             |
|will span     |some text will |               |             |
|several       |go that spans  |               |             |
|columns and   |several rows.  |               |             |
|needs to      |---------------|---------------|             |
|left-centered |This is where  |               |             |
|justified.    |some text will |               |             |
|              |go that spans  |               |             |
|              |several rows.  |               |             |
|--------------|---------------|---------------|-------------|
share|improve this question
    
Are the entries in column 1 and 2 dependent or independent? That is, does an entry in column 1 summarize what is written in the three rows it spans or does it give a category for the three rows it spans? Is it always three or does it vary? If it varies is there are rule how it varies or perhaps an external file that contains the data? –  uli Feb 2 '12 at 14:49
    
Welcome to TeX.sx! As new user without image posting privileges simply include the image as normal and remove the ! in front of it to turn it into a link. A moderator or another user with edit privileges can then reinsert the ! to turn it into an image again. –  N.N. Feb 2 '12 at 15:51
    
@DavidCarlisle Please turn your comment into an answer. –  lockstep Mar 3 '12 at 22:35
    
@lockstep comment expanded to an answer as requested –  David Carlisle Mar 3 '12 at 23:07

1 Answer 1

You say that you don't want to manually give the number of rows, but there must be some algorithm that says which rows it is to cover. If you could specify the last row, LaTeX could be persuaded to count rows. If you mean it's the whole table, then longtable is not the right package, as it won't break the spanning entry, so that would block breaking of the table so you could more simply do it with a \parbox for column 1 and a normal table for the rest, something like

\parbox[t]{....}%
\begin{tabular}[t]{lll}
header2&header3&header4\\....
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.