我想使用 longtable 包在 Latex 中制作下表:
我现在的代码有 5 列,但不幸的是我不知道如何合并这两列。如何重现图中的表格?
到目前为止我使用以下代码:
\begin{table}[]
\begin{tabular}{|l|l|l|l|l|}
\hline
& WITS &ASUS & & \\ \hline
Frequency of Substance Use & Past 7 days & Past 30 days &Past 6 months & Lifetime \\ \hline
Alcohol& & & & \\ \hline
Marijuana& & & & \\ \hline
Cocaine& & & & \\ \hline
Opiates& & & & \\ \hline
Heroin& & & & \\ \hline
Amphetamines& & & & \\ \hline
Hallucinogens& & & & \\ \hline
Inhalants& & & & \\ \hline
Barbiturates& & & & \\ \hline
Sedatives& & & & \\ \hline
Tranquilizers& & & & \\ \hline
\end{tabular}
\end{table}
编辑:我根据以下评论对我的代码进行了编辑:
\begin{center}
\begin{longtable}{|l|l|l|l|l|}
\caption{WITS and ASUS Substance Use Disorder.} \label{tab:long} \\
\hline \multicolumn{2}{c}{WITS}&\multicolumn{2}{c}{ASUS}\\ \hline
Frequency of Substance Use & Past 7 days & Past 30 days &Past 6 months & Lifetime \\ \hline
Alcohol& & & & \\ \hline
Marijuana& & & & \\ \hline
Cocaine& & & & \\ \hline
Opiates& & & & \\ \hline
Heroin& & & & \\ \hline
Amphetamines& & & & \\ \hline
Hallucinogens& & & & \\ \hline
Inhalants& & & & \\ \hline
Barbiturates& & & & \\ \hline
Sedatives& & & & \\ \hline
Tranquilizers& & & & \\ \hline
\end{longtable}
\end{center}
我得到的输出是:
如何在第 2 列和第 5 列之间获得 WITS 和 ASUS?