I want to produce the first two rows of this 5-column table in LaTeX:
As you can see it is a special type of tables where we see:
- itemized lists inside but inconsistently, ie. column 4 all rows have itemizes lists inside, columns 2,3, and 5 do have itemized lists in some but not all rows, column 1 has no itemized lists at all.
- the nice alignment of the table
- the candy-eye appearance like that what
booktabs
package was created for - it is a compact table that contains no unpleasant spaces
- the lists have square bullets
Code:
\documentclass{scrartcl}
\usepackage{graphicx}
\usepackage{booktabs}
\usepackage{array}
\usepackage{lscape}
\begin{document}
\begin{landscape}
\thispagestyle{empty} % hide page number
\begin{table}
\centering
\setlength{\belowcaptionskip}{\abovecaptionskip}% Correct skip for caption on top
\caption{Wide Itemized Mixed Table}
\label{tab:wide-item-tbl}
\begin{tabular}{lp{2in}p{2in}p{2in}p{2in}}
\toprule
\textbf{BSL} & \textbf{Agents} & \textbf{Practices} & \textbf{Primary barriers} & \textbf{Secondary barriers} \\
\midrule
1 & Not known to consistently cause diseases in healthy adults & standard microbiological practices & no primary barriers required, PPE & bench and sink required \\
2 & - Agents associated with human diseases - Routes of transmission include per-cutaneous injury, ingestion, mucous membrane exposure & BSL-1 practice plus: - limited access - Biohazard warning signs - ``Sharps'' precautions - Biosafety manual defining any needed waste decontamination or medical surveillance polices & Primary barriers: - BSCs or other physical containment devices used for all manipulations of agents that cause splashes or aerosols of infectious materials - PPE: Laboratory coats, gloves, face and eye protection, as needed & BSL-1 plus: - Autoclave available\\
\bottomrule
\end{tabular}%
\end{table}
\end{landscape}
\end{document}
The nearest answer I found was here, but unfortunately this answer assumes that all rows have itemized list and not some of them, so please for your kind attention to this point before labeling this post as duplicate.
Best Answer
The answer would be to put the list inside a minipage or parbox, but that is not really fun. Here is another solution with
enumitem
using thebefore
andafter
keys and the command\tablistcommand
: Usetabitemize
when you have a cell with a list only, and clear out thebefore
key with text preceding the list. The lines are correctly aligned.EDIT
It really depends on your use case, but I would probably make a table like this in a document. If you have a very long table, it would make more sense to rotate it.