Graphics, Figures & TablesQuery with complex longtable formatting

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
wfitzgerald
Posts: 5
Joined: Sat Apr 17, 2010 4:22 pm

Query with complex longtable formatting

Post by wfitzgerald »

Dear Latex Experts,

I have a table that I intend to span multiple (landscape) pages.

I understand that I can use the following package:

Code: Select all

\usepackage{longtable}
Examples I have seen, assume that there is only one row of column names and all data rows comply with that initial row of column names.

I would like to have some data rows map to one row of columns and another set of data rows to a second row of column headings within the same table.

Is this possible to achieve the following table style using a long table?

Code: Select all

\begin{landscape}
\begin{table}
\centering
\begin{tabular}{|p{0.5in} |l |l |l|}
	\hline
	\textbf{Control} & \multicolumn{3}{|p{7in}|}{\textbf{Guideline Description}}\\ \hline
	Ctl-1&\multicolumn{3}{|p{7in}|}{Some description about the control}\\ \cline{2-4}%\hline	
	&\textbf{Threat} & \textbf{Vulnerability} & \textbf{Countermeasure} \\ \cline{2-4}
	& some threat & some vulnerability & some countermeasure \\ \cline{2-4}
	& some threat & some vulnerability & some countermeasure \\ \cline{2-4}
	& some threat & some vulnerability & some countermeasure \\ \hline
	Ctl-2&\multicolumn{3}{|p{7in}|}{Some description about the control}\\ \cline{2-4}%\hline	
	&\textbf{Threat} & \textbf{Vulnerability} & \textbf{Countermeasure} \\ \cline{2-4}
	& some threat & some vulnerability & some countermeasure \\ \cline{2-4}
	& some threat & some vulnerability & some countermeasure \\ \cline{2-4}
	& some threat & some vulnerability & some countermeasure \\ \hline
	Ctl-3&\multicolumn{3}{|p{7in}|}{Some description about the control}\\ \cline{2-4}%\hline	
	&\textbf{Threat} & \textbf{Vulnerability} & \textbf{Countermeasure} \\ \cline{2-4}
	& some threat & some vulnerability & some countermeasure \\ \cline{2-4}
	& some threat & some vulnerability & some countermeasure \\ \cline{2-4}
	& some threat & some vulnerability & some countermeasure \\ \hline	
\end{tabular}
\caption{Some Table Caption Goes here}
\label{mylabel}
\end{table}
\end{landscape}
regards,
Will

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

wfitzgerald
Posts: 5
Joined: Sat Apr 17, 2010 4:22 pm

Query with complex longtable formatting

Post by wfitzgerald »

Solution was not to specify any parameters for

Code: Select all

\endfirsthead
and to manually define where to create a new page.
Post Reply