第二列中的文本显示在第一列中。我不明白为什么?有什么建议?
\begin{table*}
\begin{tabular}{|p{8cm}|p{8cm}|}
\hline \textbf{Heading 1}\\\\Text \\
& \textbf{Heading 2}\\ Text \\
\hline
\end{tabular}
\end{table*}
Run Code Online (Sandbox Code Playgroud)
乳胶表是水平格式的:&分隔单元格/列,\\指示一行单元格的结尾。将第一行指定为
A & B \\
Run Code Online (Sandbox Code Playgroud)
第二行作为
C & D \\
Run Code Online (Sandbox Code Playgroud)
所以你的情况应该被编码:
\documentclass{article}
\begin{document}
\begin{table*}
\begin{tabular}{|p{4cm}|p{4cm}|}
\hline \textbf{Heading 1} & \textbf{Heading 2}\\
Text col 1 with plenty of extra text
&Text col 2 with plenty of extra text\\
\hline
\end{tabular}
\end{table*}
\end{document}
Run Code Online (Sandbox Code Playgroud)
(为了显示目的,我减少了单元格的宽度。)
如果你想在给定的单元格中换行,只需在输入文件中留一个空行。这里有两种不同的文本处理方式。
\documentclass{article}
\begin{document}
\begin{table*}
\begin{tabular}{|p{4cm}|p{4cm}|}
\hline \textbf{Heading 1} & \textbf{Heading 2}\\
Text col 1 with plenty of extra text.
And more lines of text in column one.
Yet more lines.
&Text col 2 with plenty of extra text.\\
\hline
\end{tabular}
\end{table*}
\begin{table*}
\begin{tabular}{|p{4cm}|p{4cm}|}
\hline \textbf{Heading 1}
Text col 1 with plenty of extra text.
And more lines of text in column one.
Yet more lines.
&\textbf{Heading 2}
Text col 2 with plenty of extra text.\\
\hline
\end{tabular}
\end{table*}
\end{document}
Run Code Online (Sandbox Code Playgroud)