Please help me make a table which looks like this:
Code: Select all
______________________
| A | B |
|------|---------------|
| A1\n | B1 B1 B1 B1\ |
| A2\n | B1 B1 B1 B1\n |
| A3\n | B2 B2 B2 B2\ |
| | B2 B2 B2 B2\n |
| | B3 B3 B3 B3 |
| | .... |
Requirements:
1. Must be automatically split whenever it's longer a page.
2. Text should start on top of both columns. Newlines in both columns don't affect each other. For example, This is wrong:
Code: Select all
______________________
| A | B |
|------|---------------|
| A1\n | |
| A2\n | |
| A3\n | |
| | B1 B1 B1 B1\ |
| | B1 B1 B1 B1\n |
| | B2 B2 B2 B2\ |
| | B2 B2 B2 B2\n |
| | B3 B3 B3 B3 |
| | .... |
Code: Select all
\documentclass[a4paper]{report}
\usepackage{longtable}
\begin{document}
{\centering
\begin{longtable}{|p{3cm}|p{3cm}|}
\hline
\begin{tabular}[t]{p{3cm}}
A
\end{tabular}
&\begin{tabular}[t]{p{3cm}}
B
\end{tabular}
\tabularnewline
\hline
\begin{tabular}[t]{p{3cm}}
A1\\A2\\A3
\end{tabular}
&\begin{tabular}[t]{p{3cm}}
B1\ B1\ B1\ B1\\B2\ B2\ B2\ B2\ B2\ B2\\B3\ B3\ B3\ B3\ B3\ B3\ <lots of text...>
\end{tabular}
\tabularnewline
\hline
\end{longtable}
}
\end{document}