我试图将两个迷你页面并排放置,每个页面内都有一个表格。但是由于某种原因,它们重叠了,我在这里做了一些研究,但提供的解决方案对我都不起作用,有人能指出为什么表格不是完全并排的吗?谢谢。
以下是代码:
\documentclass{article}
\usepackage[utf8]{inputenc}
\begin{document}
\noindent
\begin{minipage}{0.49\hsize}
\begin{tabular}{|c|c|}
1-Alex Mateus Gianetti & 99981-9517 \\
2-Alinne Freitas Signorelli & 99100-6388 \\
3-Ana Claudia Perroni & 99296-5945 \\
4-Ana Estela Delgado & 98112-3965 \\
5-Ana Paula de Siqueira Faria & 99200-9854 \\
6-Ana Paula Falcão Lima & 98132-1331 \\
7-Ana Paula Santos Fava & \\
8-André Lacerda & 99271-0340 \\
9-André Yuri de Oliveira Borges & 99262-8895 \\
10-Andreia Mantovani & 98123-7691
\end{tabular}
\end{minipage}%
\begin{minipage}{0.49\hsize}
\begin{tabular}{|c|c|}
50-Isadora Cacho Justino & 99189-8499 \\
51-Isadora Gouveia Lara Bueno & 98435-1645 \\
52-Jeperson Pedro de Oliveira & 98152-0000 \\
53-Jéssica Melo & 99101-7979 \\
54-Joana Camargo Marchezan & 99683-5978 \\
55-João Paulo Correa da Silveira & 99296-3438 \\
56-José Henrique Avila de Rezende & 99985-8175 \\
57-José Melo & 99951-2737 \\
58-José Rodrigues Maria & 98467-4688 \\
59-Juliane Vogel & 99241-4765 \\
60-Karina Barbosa de Alencar Oliveira & 99208-8128
\end{tabular}
\end{minipage}
\end{document}
结果如下:
答案1
嗯,这取决于你需要什么,但我在这里看到两种可能性:
- 更改
c
为p{3cm}
或您需要的值。 - 使用 package
tabularx
和 environmenttabularx
代替 environmenttabular
。使用 package可以获得更好地对左对齐文本进行连字的ragged2e
命令。\RaggedRight
以下 MWE 显示了两种可能性:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{tabularx} % <===============================================
\usepackage{ragged2e} % <===============================================
\usepackage{showframe}
\begin{document}
\noindent
\begin{minipage}{0.49\hsize}
\begin{tabular}{|p{3cm}|c|}
1-Alex Mateus Gianetti & 99981-9517 \\
2-Alinne Freitas Signorelli & 99100-6388 \\
3-Ana Claudia Perroni & 99296-5945 \\
4-Ana Estela Delgado & 98112-3965 \\
5-Ana Paula de Siqueira Faria & 99200-9854 \\
6-Ana Paula Falcão Lima & 98132-1331 \\
7-Ana Paula Santos Fava & \\
8-André Lacerda & 99271-0340 \\
9-André Yuri de Oliveira Borges & 99262-8895 \\
10-Andreia Mantovani & 98123-7691
\end{tabular}
\end{minipage}%
\hfil
\begin{minipage}{0.49\hsize}
\begin{tabular}{|p{3cm}|c|}
50-Isadora Cacho Justino & 99189-8499 \\
51-Isadora Gouveia Lara Bueno & 98435-1645 \\
52-Jeperson Pedro de Oliveira & 98152-0000 \\
53-Jéssica Melo & 99101-7979 \\
54-Joana Camargo Marchezan & 99683-5978 \\
55-João Paulo Correa da Silveira & 99296-3438 \\
56-José Henrique Avila de Rezende & 99985-8175 \\
57-José Melo & 99951-2737 \\
58-José Rodrigues Maria & 98467-4688 \\
59-Juliane Vogel & 99241-4765 \\
60-Karina Barbosa de Alencar Oliveira & 99208-8128
\end{tabular}
\end{minipage}
Second possibility:
\noindent
\begin{minipage}{0.49\hsize}
\begin{tabularx}{\linewidth}{|>{\RaggedRight}X|c|} % <==================
1-Alex Mateus Gianetti & 99981-9517 \\
2-Alinne Freitas Signorelli & 99100-6388 \\
3-Ana Claudia Perroni & 99296-5945 \\
4-Ana Estela Delgado & 98112-3965 \\
5-Ana Paula de Siqueira Faria & 99200-9854 \\
6-Ana Paula Falcão Lima & 98132-1331 \\
7-Ana Paula Santos Fava & \\
8-André Lacerda & 99271-0340 \\
9-André Yuri de Oliveira Borges & 99262-8895 \\
10-Andreia Mantovani & 98123-7691
\end{tabularx}
\end{minipage}%
\hfil
\begin{minipage}{0.49\hsize}
\begin{tabularx}{\linewidth}{|>{\RaggedRight}X|c|} % <==================
50-Isadora Cacho Justino & 99189-8499 \\
51-Isadora Gouveia Lara Bueno & 98435-1645 \\
52-Jeperson Pedro de Oliveira & 98152-0000 \\
53-Jéssica Melo & 99101-7979 \\
54-Joana Camargo Marchezan & 99683-5978 \\
55-João Paulo Correa da Silveira & 99296-3438 \\
56-José Henrique Avila de Rezende & 99985-8175 \\
57-José Melo & 99951-2737 \\
58-José Rodrigues Maria & 98467-4688 \\
59-Juliane Vogel & 99241-4765 \\
60-Karina Barbosa de Alencar Oliveira & 99208-8128
\end{tabularx}
\end{minipage}
\end{document}
结果如下:
答案2
左侧表格的宽度为 213.75037pt,但 49% 的文本宽度仅为 169.0519pt,超出部分超出了小页面的右边距。
您有两个选择,同样糟糕:选择一是缩放表格,但您会得到不同的字体大小;选择二是让表格超出页边距。
第三种选择是自己减小字体大小,但即使有\scriptsize
两张表格也放不下。
选择四:重新格式化名称。
\documentclass{article}
\usepackage[utf8]{inputenc}
\newcommand{\nm}[3]{%
\begin{tabular}{@{}l@{}l@{}}
\ifnum#1<10 \phantom{0}\fi#1\,-\,&
#2\\
\end{tabular}%
}
\begin{document}
\begin{center}\small
\begin{tabular}{|l|c|}
\nm{1}{Alex Mateus}{Gianetti} & 99981-9517 \\
\nm{2}{Alinne Freitas}{Signorelli} & 99100-6388 \\
\nm{3}{Ana Claudia}{Perroni} & 99296-5945 \\
\nm{4}{Ana Estela}{Delgado} & 98112-3965 \\
\nm{5}{Ana Paula}{de Siqueira Faria} & 99200-9854 \\
\nm{6}{Ana Paula}{Falcão Lima} & 98132-1331 \\
\nm{7}{Ana Paula}{Santos Fava} & \\
\nm{8}{André}{Lacerda} & 99271-0340 \\
\nm{9}{André Yuri}{de Oliveira Borges} & 99262-8895 \\
\nm{10}{Andreia}{Mantovani} & 98123-7691
\end{tabular}\hfill
\begin{tabular}{|l|c|}
\nm{50}{Isadora}{Cacho Justino} & 99189-8499 \\
\nm{51}{Isadora Gouveia}{Lara Bueno} & 98435-1645 \\
\nm{52}{Jeperson Pedro}{de Oliveira} & 98152-0000 \\
\nm{53}{Jéssica}{Melo} & 99101-7979 \\
\nm{54}{Joana}{Camargo Marchezan} & 99683-5978 \\
\nm{55}{João Paulo}{Correa da Silveira } & 99296-3438 \\
\nm{56}{José Henrique}{Avila de Rezende} & 99985-8175 \\
\nm{57}{José}{Melo} & 99951-2737 \\
\nm{58}{José}{Rodrigues Maria} & 98467-4688 \\
\nm{59}{Juliane}{Vogel} & 99241-4765 \\
\nm{60}{Karina Barbosa}{de Alencar Oliveira} & 99208-8128
\end{tabular}
\end{center}
\end{document}
缩放后:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{lipsum}
\begin{document}
\lipsum[3]
\begin{center}
\resizebox{\textwidth}{!}{%
\begin{tabular}{|c|c|}
1-Alex Mateus Gianetti & 99981-9517 \\
2-Alinne Freitas Signorelli & 99100-6388 \\
3-Ana Claudia Perroni & 99296-5945 \\
4-Ana Estela Delgado & 98112-3965 \\
5-Ana Paula de Siqueira Faria & 99200-9854 \\
6-Ana Paula Falcão Lima & 98132-1331 \\
7-Ana Paula Santos Fava & \\
8-André Lacerda & 99271-0340 \\
9-André Yuri de Oliveira Borges & 99262-8895 \\
10-Andreia Mantovani & 98123-7691
\end{tabular}%
\begin{tabular}{|c|c|}
50-Isadora Cacho Justino & 99189-8499 \\
51-Isadora Gouveia Lara Bueno & 98435-1645 \\
52-Jeperson Pedro de Oliveira & 98152-0000 \\
53-Jéssica Melo & 99101-7979 \\
54-Joana Camargo Marchezan & 99683-5978 \\
55-João Paulo Correa da Silveira & 99296-3438 \\
56-José Henrique Avila de Rezende & 99985-8175 \\
57-José Melo & 99951-2737 \\
58-José Rodrigues Maria & 98467-4688 \\
59-Juliane Vogel & 99241-4765 \\
60-Karina Barbosa de Alencar Oliveira & 99208-8128
\end{tabular}}
\end{center}
\end{document}
答案3
您有两个主要选择:
如果你不是想要在第 1 列和第 3 列中允许换行,您需要切换到很小的字体大小,例如
\tiny
;如果您想使用接近标准字体大小的字体,则需要在文本列中允许换行。
无论哪种方式,我建议您使用tabularx
环境而不是minipage
环境。
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{tabularx}
\begin{document}
\noindent
font size: tiny (50\% smaller than ``normalsize'')
\tiny
\setlength\tabcolsep{3pt} % default: 6pt
\noindent
\begin{tabularx}{0.5\textwidth}[t]{|>{\raggedright}X|l}
1-Alex Mateus Gianetti & 99981-9517 \\
2-Alinne Freitas Signorelli & 99100-6388 \\
3-Ana Claudia Perroni & 99296-5945 \\
4-Ana Estela Delgado & 98112-3965 \\
5-Ana Paula de Siqueira Faria & 99200-9854 \\
6-Ana Paula Falcão Lima & 98132-1331 \\
7-Ana Paula Santos Fava & \\
8-André Lacerda & 99271-0340 \\
9-André Yuri de Oliveira Borges & 99262-8895 \\
10-Andreia Mantovani & 98123-7691
\end{tabularx}%
\begin{tabularx}{0.5\textwidth}[t]{|>{\raggedright}X|l|}
50-Isadora Cacho Justino & 99189-8499 \\
51-Isadora Gouveia Lara Bueno & 98435-1645 \\
52-Jeperson Pedro de Oliveira & 98152-0000 \\
53-Jéssica Melo & 99101-7979 \\
54-Joana Camargo Marchezan & 99683-5978 \\
55-João Paulo Correa da Silveira & 99296-3438 \\
56-José Henrique Avila de Rezende & 99985-8175 \\
57-José Melo & 99951-2737 \\
58-José Rodrigues Maria & 98467-4688 \\
59-Juliane Vogel & 99241-4765 \\
60-Karina Barbosa de Alencar Oliveira & 99208-8128
\end{tabularx}
\bigskip
\normalsize\noindent
font size: small (10\% smaller than ``normalsize'')
\small
\noindent
\begin{tabularx}{0.5\textwidth}[t]{|>{\raggedright}X|l}
1-Alex Mateus Gianetti & 99981-9517 \\
2-Alinne Freitas Signorelli & 99100-6388 \\
3-Ana Claudia Perroni & 99296-5945 \\
4-Ana Estela Delgado & 98112-3965 \\
5-Ana Paula de Siqueira Faria & 99200-9854 \\
6-Ana Paula Falcão Lima & 98132-1331 \\
7-Ana Paula Santos Fava & \\
8-André Lacerda & 99271-0340 \\
9-André Yuri de Oliveira Borges & 99262-8895 \\
10-Andreia Mantovani & 98123-7691
\end{tabularx}%
\begin{tabularx}{0.5\textwidth}[t]{|>{\raggedright}X|l|}
50-Isadora Cacho Justino & 99189-8499 \\
51-Isadora Gouveia Lara Bueno & 98435-1645 \\
52-Jeperson Pedro de Oliveira & 98152-0000 \\
53-Jéssica Melo & 99101-7979 \\
54-Joana Camargo Marchezan & 99683-5978 \\
55-João Paulo Correa da Silveira & 99296-3438 \\
56-José Henrique Avila de Rezende & 99985-8175 \\
57-José Melo & 99951-2737 \\
58-José Rodrigues Maria & 98467-4688 \\
59-Juliane Vogel & 99241-4765 \\
60-Karina Barbosa de Alencar Oliveira & 99208-8128
\end{tabularx}
\end{document}