I want to insert a table into my document with latex:
\begin{table}[htbp]
\centering
\caption{}
\begin{tabular}{l|l|l|l|l|l|l}
\hline
\hline
\multicolumn{1}{r}{\multirow{}} & \multicolumn{2}{c|}{\textbf{S\&P500}} & \multicolumn{2}{c|}{\textbf{GS10}} & \multicolumn{2}{c}{\textbf{TWEXMMTH}} \bigstrut\\
\cline{2-7} \multicolumn{1}{r}{} & \multicolumn{1}{c|}{\textbf{p-value}} & \multicolumn{1}{c|}{\textbf{Yes/No}} & \multicolumn{1}{c|}{\textbf{p-value}} & \multicolumn{1}{c|}{\textbf{Yes/No}} & \multicolumn{1}{c|}{\textbf{p-value}} & \multicolumn{1}{c}{\textbf{Yes/No}} \bigstrut\\
\hline
\hline
\textbf{PFANDB} & 0,000 & Yes & 0,193 & No & 0,487 & No \bigstrut\\
\hline
\textbf{PRAWM} & 0,001 & Yes & 0,287 & No & 0,601 & No \bigstrut\\
\hline
\textbf{PNRG} & 0,001 & Yes & 0,002 & Yes & 0,543 & No \bigstrut\\
\hline
\textbf{PMETA} & 0,014 & Yes & 0,052 & No & 0,537 & No \bigstrut\\
\hline
\textbf{GOLD} & 0,359 & No & 0,709 & No & 0,166 & No \bigstrut\\
\hline
\hline
\end{tabular}%
\label{tab:addlabel}%
\end{table}%
but it returns all the time the errors:
! Undefined control sequence.
\@sharp ->\multirow
{}
l.58 \multicolumn{1}{r}{\multirow{}}
& \multicolumn{2}{c|}{\textbf{S\&P5...
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
LaTeX Font Info: Font shape `T1/ppl/bx/n' in size <10.95> not available
(Font) Font shape `T1/ppl/b/n' tried instead on input line 58.
! Undefined control sequence.
l.58 ...icolumn{2}{c}{\textbf{TWEXMMTH}} \bigstrut
\\
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
l.59 ...column{1}{c}{\textbf{Contagion}} \bigstrut
\\
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
l.62 ...s & 0,193 & No & 0,487 & No \bigstrut
\\
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
l.64 ...s & 0,287 & No & 0,601 & No \bigstrut
\\
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
l.66 ...s & 0,002 & Yes & 0,543 & No \bigstrut
\\
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
l.68 ...s & 0,052 & No & 0,537 & No \bigstrut
\\
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
l.70 ... & 0,709 & No & 0,166 & No \bigstrut
\\
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined....
I don't really understand. Can someone explain to me? Thank you in advance!
Best Answer
It seems you don't need
multirow
, and the code would be simpler without having tp repeat endlessly\bigstrut
: themakecell
package defines a\makegapedcells
which adds some custom padding at the top and bottom of cells. Additionally, thecaption
package yields a more sensible spacing between captions and tables, when captions are above tables: