I am trying to make a table with multiline values in a cell. Following is the MWE:
\documentclass[12pt]{article}
\usepackage[a4paper, total={170mm,262mm}, left=20mm, top=20mm]{geometry}
\usepackage{booktabs}
\usepackage{multirow}
\pagestyle{empty}
\begin{document}
\begin{table}[ht]
\centering
\caption{Studies that made a quantitative estimate of the parameters for the analysis on the blah blah blah blah}
\begin{tabular}{p{3.8cm}p{2cm}p{4cm}p{5cm}}
\hline
{\bf Study} & {\bf Study} & {\bf Lead time} & {\bf Methodology for}\\
{\bf location} & {\bf Period} & {\bf (days)} & {\bf qualifying lead time.}\\
\hline
City 1, Country 1 & Jun--Aug 2020 & 2 & \textit{Method 1}: attribute 1 vs attribute 2 \\
City 2, Country 2 (detail A, detail b) & Aug 2020--Jan 2021 &
0 to 6 (different sublocations) & \textit{Method 2}: attribute 1 vs attribute 2 given a certain preprocessing (7-day) \\
\hline
\end{tabular}
\end{table}
\end{document}
The output has issues and is as follows:
Instead of the above, I want to obtain a neat-looking table with the following features:
- Table spanning the text (line) width
- Reasonable spacing between the table caption and the body
- Word wrapping wherever the content goes beyond column width (including the table headers).
- First column: I want the city and the country in separate lines. If there is additional text, it should come further below with word wrapping.
- Left justification for everything (I am okay if we have centre-justified column headers)
- No underfull/overfull warnings
- Sufficient space between the rows (The above table looks bad if we add more rows)
An example of a desirable table (generated in MS-Word), but without caption, looks like this:
Can anyone suggest how to get such a table?
\bf
has not been recommended since the early 90s. Use\textbf{....}
instead.\belowcaptionskip
is 0pt, but several packages etc. swap with\abovecaptionskip
for tables.