[Tex/LaTex] Change linespacing on a single row of a table

line-spacingspacingtables

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 the pbox package, loaded array instead, and defined a new column type which does the same as your \pboxes but with a different \linespread.

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{array}
\linespread{1.3}
\newcolumntype{M}{>{\linespread{1}\selectfont\centering}m{2cm}}
\begin{document}
\begin{table}[!h]
  \begin{center}       
    \begin{tabular}{lcccc} 
    \hline\hline
       Appliance  & \multicolumn{1}{M}{Max power demand (watts)} & 
       \multicolumn{1}{M}{On power threshold (watts)} & 
       \multicolumn{1}{M}{Min. on duration (secs)} & 
       \multicolumn{1}{M}{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}

enter image description here