首页 > 解决方案 > 如何在 LaTeX 中将我的桌子放在彼此下方

问题描述

我在将表 11 放在 laTex 中的表 10 下时遇到问题。对于我一直在使用的桌子[!],并[h]让我的桌子在彼此下方显示,但现在一旦我到达桌 11,它就不会在桌 10 下

我试图做一些使用浮动包并放入包中的方法,但似乎没有进行任何更改。

我之前也遇到过这个问题,因为起初我正在使用[h]并且所有表格都在彼此下方,但后来它停止工作所以我使用[!]但现在这不起作用

这是表 10

\begin{table}[!]
\begin{tabular}{|l|l|}
\hline
Test\#        & 10                                                                                                        
\\ \hline
Content       & \begin{tabular}[c]{@{}l@{}}Testing emails to be registered 
when signing up\\ to be a lender.\end{tabular} \\ \hline
Input         & Signing up and lending out a product.                                                                     
\\ \hline
Pass Criteria & Signing up with the ability to lend out products.                                                         
\\ \hline
\end{tabular}
\end{table}

表 11 是相同的,但它不会放在表 10 下,而是 laTex 将它随机放置在某个地方

\begin{table}[!]
\begin{tabular}{|l|l|}
\hline
Test\#        & 11                                                                                                                              
\\ \hline
Content       & \begin{tabular}[c]{@{}l@{}}Testing the billing information 
input to see \\ if it works.\end{tabular}                            \\ 
\hline
Input         & \begin{tabular}[c]{@{}l@{}}The user rents out a product 
and check if\\ billing information is appearing correctly.\end{tabular} \\ 
\hline
Pass Criteria & \begin{tabular}[c]{@{}l@{}}Billing information appears 
when checkout is\\ completed.\end{tabular}                               
\\ \hline
\end{tabular}
\end{table}

有什么办法可以正确地将表 11 直接放在表 10 下方,而不是像下面显示的图像那样随机放置。先感谢您

在此处输入图像描述

标签: latex

解决方案


我建议另一种方法,如果表格应该直接相互跟随,请将它们放在相同的浮动环境中:

\documentclass{article}
\usepackage{float}

\begin{document}

\begin{table}[htbp]
\begin{tabular}{|l|l|}
\hline
Test\#        & 10                                                                                                        
\\ \hline
Content       & \begin{tabular}[c]{@{}l@{}}Testing emails to be registered 
when signing up\\ to be a lender.\end{tabular} \\ \hline
Input         & Signing up and lending out a product.                                                                     
\\ \hline
Pass Criteria & Signing up with the ability to lend out products.                                                         
\\ \hline
\end{tabular}

\bigskip

\begin{tabular}{|l|l|}
\hline
Test\#        & 11                                                                                                                              
\\ \hline
Content       & \begin{tabular}[c]{@{}l@{}}Testing the billing information 
input to see \\ if it works.\end{tabular}                            \\ 
\hline
Input         & \begin{tabular}[c]{@{}l@{}}The user rents out a product 
and check if\\ billing information is appearing correctly.\end{tabular} \\ 
\hline
Pass Criteria & \begin{tabular}[c]{@{}l@{}}Billing information appears 
when checkout is\\ completed.\end{tabular}                               
\\ \hline
\end{tabular}
\end{table}
\end{document}

推荐阅读