0

I'm using the tabular environment. I would like for one row (where I describe each subsection) to go horizontally across the table, and not to stay in one column. This is what I currently have:

\begin{center}
\begin{tabular}{p{4cm} p{13cm}}
\textbf{Table 1} I would like this to go across the table and not stay in column 1\\ \hline
\textit{Predisposing factors} \\ \hline
variable 1 & description \\
variable 2 & description \\
variable i & description \\
\textit{I would like this to go across the table as well} \\
\end{tabular}
\end{center}

I would really appreciate any help.

4
  • 2
    You are looking for multicolumn i think.
    – Johannes_B
    Jul 4, 2015 at 15:29
  • 2
    and of course \captionof{table}{the actual caption} for the caption. No need to number by hand. Using a float environment would have some benefits though.
    – Johannes_B
    Jul 4, 2015 at 15:31
  • @Johannes_B An answer?
    – cfr
    Jul 5, 2015 at 2:48
  • @cfr I bet this is a clear duplicate, i am just to lazy to search for a matching one. Do you want to answer?
    – Johannes_B
    Jul 5, 2015 at 7:10

1 Answer 1

1
\begin{center}
\begin{table}
\begin{tabular}{p{4cm} p{13cm}}
\multicolumn{2}{l}{\textbf{Table 1} This will now go across the table} \hline
\textit{Predisposing factors} \\ \hline
variable 1 & description \\
variable 2 & description \\
variable i & description \\
\end{tabular}
\end{table}
\end{center}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .