我有以下 4 张表格:
\documentclass[11pt]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[table]{xcolor}
\begin{document}
\begin{tabular}{||c c c||}
\hline
Points & X(m) & t(s)\\ [0.5ex]
\hline\hline
0 & 0 & 0\\
\hline
1 & 2 & 1.48 \\
\hline
2 & 4 & 2.76 \\
\hline
3 & 6 & 4.02 \\
\hline
4 & 8 & 5.22 \\
\hline
5 & 10 & 6.43 \\
\hline
6 & 12 & 7.76 \\
[1ex]
\hline
\end{tabular}
\begin{tabular}{||c c c||}
\hline
Points & X(m) & t(s)\\ [0.5ex]
\hline\hline
0 & 12 & 0\\
\hline
1 & 10 & 1.53 \\
\hline
2 & 8 & 2.94\\
\hline
3 & 6 & 4.53 \\
\hline
4 & 4 & 5.96 \\
\hline
5 & 2 & 7.36 \\
\hline
6 & 0 & 8.83 \\
[1ex]
\hline
\end{tabular}
\begin{tabular}{||c c c||}
\hline
Points & X(m) & t(s)\\ [0.5ex]
\hline\hline
0 & 0 & 0\\
\hline
1 & 2 & 1.48 \\
\hline
2 & 4 & 2.76 \\
\hline
3 & 6 & 4.02 \\
\hline
4 & 8 & 5.22 \\
\hline
5 & 10 & 6.43 \\
\hline
6 & 12 & 7.76 \\
[1ex]
\hline
\end{tabular}
\begin{tabular}{||c c c||}
\hline
Points & X(m) & t(s)\\ [0.5ex]
\hline\hline
0 & 12 & 0\\
\hline
1 & 10 & 1.80 \\
\hline
2 & 8 & 3.46 \\
\hline
3 & 6 & 4.94 \\
\hline
4 & 4 & 6.49 \\
\hline
5 & 2 & 8.20 \\
\hline
6 & 0 & 9.85 \\
[1ex]
\hline
\end{tabular}
\end{document}
我想将四张桌子排列成 2x2 的网格,因为现在桌子占用了太多空间。我该如何实现?
答案1
表格之间的空行会在每个表格的新行开始。删除前两个表格和后两个表格之间的空行。例如:
\documentclass[11pt]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[table]{xcolor}
\begin{document}
\begin{center}
\begin{tabular}{||c c c||}
\hline
Points & X(m) & t(s)\\ [0.5ex]
\hline\hline
0 & 0 & 0\\
\hline
1 & 2 & 1.48 \\
\hline
2 & 4 & 2.76 \\
\hline
3 & 6 & 4.02 \\
\hline
4 & 8 & 5.22 \\
\hline
5 & 10 & 6.43 \\
\hline
6 & 12 & 7.76 \\
[1ex]
\hline
\end{tabular}
\hfil %<---
\begin{tabular}{||c c c||}
\hline
Points & X(m) & t(s)\\ [0.5ex]
\hline\hline
0 & 12 & 0\\
\hline
1 & 10 & 1.53 \\
\hline
2 & 8 & 2.94\\
\hline
3 & 6 & 4.53 \\
\hline
4 & 4 & 5.96 \\
\hline
5 & 2 & 7.36 \\
\hline
6 & 0 & 8.83 \\
[1ex]
\hline
\end{tabular}
\medskip
\begin{tabular}{||c c c||}
\hline
Points & X(m) & t(s)\\ [0.5ex]
\hline\hline
0 & 0 & 0\\
\hline
1 & 2 & 1.48 \\
\hline
2 & 4 & 2.76 \\
\hline
3 & 6 & 4.02 \\
\hline
4 & 8 & 5.22 \\
\hline
5 & 10 & 6.43 \\
\hline
6 & 12 & 7.76 \\
[1ex]
\hline
\end{tabular}
\hfil %<---
\begin{tabular}{||c c c||}
\hline
Points & X(m) & t(s)\\ [0.5ex]
\hline\hline
0 & 12 & 0\\
\hline
1 & 10 & 1.80 \\
\hline
2 & 8 & 3.46 \\
\hline
3 & 6 & 4.94 \\
\hline
4 & 4 & 6.49 \\
\hline
5 & 2 & 8.20 \\
\hline
6 & 0 & 9.85 \\
[1ex]
\hline
\end{tabular}
\end{center}
\end{document}