为了制作框架,我尝试使用和longtable
以下代码:\fbox
\minipage
\documentclass[10pt,a4paper]{article}
{\renewcommand{\arraystretch}{1.5}%
\usepackage{longtable}
\begin{document}\textbf{}
\centering\fbox{
\begin{minipage}{\linewidth}%
\begin{longtable}{lcc}
Number & Odd/Even \\
\hline
1 & Odd \\
2 & Even \\
3 & Odd \\
4 & Even \\
5 & Odd \\
6 & Even \\
7 & Odd \\
8 & Even \\
9 & Odd \\
10 & Even \\
11 & Odd \\
12 & Even \\
13 & Odd \\
14 & Even \\
15 & Odd \\
16 & Even \\
17 & Odd \\
18 & Even \\
19 & Odd \\
20 & Even \\
21 & Odd \\
22 & Even \\
23 & Odd \\
24 & Even \\
25 & Odd \\
26 & Even \\
27 & Odd \\
28 & Even \\
29 & Odd \\
30 & Even \\
31 & Odd \\
32 & Even \\
33 & Odd \\
34 & Even \\
35 & Odd \\
36 & Even \\
37 & Odd \\
38 & Even \\
39 & Odd \\
40 & Even \\
41 & Odd \\
42 & Even \\
43 & Odd \\
44 & Even \\
45 & Odd \\
46 & Even \\
47 & Odd \\
48 & Even \\
49 & Odd \\
50 & Even \\
\end{longtable}
\end{minipage} }
\end{document}
然而,表格是在第 2 页建立的,并且longtable
(多页上的长表格)不幸不起作用。
答案1
放入longtable
一个不易破碎的东西minipage
,而把这个放在不易破碎的东西里,这\fbox
很奇怪。
如果桌子是盒装的并且易碎,那么可以使用tcolorbox
其易碎功能。
\documentclass[10pt,a4paper]{article}
\renewcommand{\arraystretch}{1.5}%
\usepackage{longtable}
\usepackage[most]{tcolorbox}
\newtcolorbox{tabframebox}[1][]{breakable,sharp corners,boxrule=0.5pt,colback=white,halign=center,#1}
\begin{document}
\begin{tabframebox}
\begin{longtable}{lcc}
Number & Odd/Even \\
\hline
1 & Odd \\
2 & Even \\
3 & Odd \\
4 & Even \\
5 & Odd \\
6 & Even \\
7 & Odd \\
8 & Even \\
9 & Odd \\
10 & Even \\
11 & Odd \\
12 & Even \\
13 & Odd \\
14 & Even \\
15 & Odd \\
16 & Even \\
17 & Odd \\
18 & Even \\
19 & Odd \\
20 & Even \\
21 & Odd \\
22 & Even \\
23 & Odd \\
24 & Even \\
25 & Odd \\
26 & Even \\
27 & Odd \\
28 & Even \\
29 & Odd \\
30 & Even \\
31 & Odd \\
32 & Even \\
33 & Odd \\
34 & Even \\
35 & Odd \\
36 & Even \\
37 & Odd \\
38 & Even \\
39 & Odd \\
40 & Even \\
41 & Odd \\
42 & Even \\
43 & Odd \\
44 & Even \\
45 & Odd \\
46 & Even \\
47 & Odd \\
48 & Even \\
49 & Odd \\
50 & Even \\
\end{longtable}
\end{tabframebox}
\end{document}