I'd like to change the linespacing for a single row of a table. My whole document uses \linespread{1.3}
but on this table it seems too much. Actually, I like it in all rows except the first. I figured out that by including \usepackage{setspace}
in my documents it makes the linespread of tables and floats equal to 1 without changing the text of my documents. I still don't like this though. I want linespread{1}
for the first row and linespread{1.3}
for the other rows and the rest of the document.
This is my code:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{pbox}
\linespread{1.3}
\begin{document}
\begin{table}[!h]
\begin{center}
\begin{tabular}{lcccc}
\hline\hline
Appliance & \pbox{2cm}{\centering Max power demand (watts)} & \pbox{2cm}{\centering On power threshold (watts)} & \pbox{2cm}{\centering Min. on duration (secs)} & \pbox{2cm}{\centering Min. off duration (secs)} \\
\hline
A & 3100 & 2000 & 12 & 0 \\
B & 300 & 50 & 60 & 12 \\
C & 2500 & 20 & 1800 & 160 \\
D & 3000 & 200 & 12 & 30 \\
E & 2500 & 10 & 1800 & 1800 \\
\hline\hline
\end{tabular}
\end{center}
\end{table}
\end{document}
Best Answer
This is an ad hoc fix: set
\linespread{1}
where needed. I kicked out thepbox
package, loadedarray
instead, and defined a new column type which does the same as your\pbox
es but with a different\linespread
.