创建基本表时遇到问题

创建基本表时遇到问题

我想创建一个表,如下所示:

在此处输入图片描述

\documentclass[a4paper,12pt,oneside]{article}
\usepackage[english]{babel}
\usepackage{tikz}
\usepackage{pgf}
\usetikzlibrary{shapes,arrows,positioning,calc,threeparttable} 
\usepackage{tabu}
\usepackage{hyperref}
\usepackage{longtable}
\usepackage{array}
\usepackage{multirow,tabularx,booktabs}
\begin{document}
\begin{tabular}{|c|c|}
\hline 
\bf{Text A:} & \bf{Text B:} \\ 
\hline 
"Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat." & "Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat." \\ 
\hline 
\end{tabular} 
\end{document}

有人能帮我吗?

答案1

根据您真正想要实现的目标,有以下几种可能性:

\documentclass[a4paper,12pt,oneside]{article}
\usepackage[english]{babel}
\usepackage{tikz}
\usepackage{pgf}
%\usetikzlibrary{shapes,arrows,positioning,calc,threeparttable} 
\usepackage{tabu}
\usepackage{hyperref}
\usepackage{longtable}
\usepackage{array}
\usepackage{multirow,tabularx,booktabs}
\parskip 1em
\begin{document}
\noindent\hrulefill

Tiny to get specified text layout

{\centering\tiny\begin{tabular}{cc}
\textbf{Text A:} & \textbf{Text B:} \\ 
\parbox[t]{.45\textwidth}{\centering ``Lorem ipsum dolor sit amet, 
consectetuer adipiscing elit, sed diam 
nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat 
volutpat.''} & 
\parbox[t]{.45\textwidth}{\centering``Lorem ipsum dolor sit amet, 
consectetuer adipiscing elit, sed diam 
nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat 
volutpat.''}  \\ 
\end{tabular}\par}

Normalsize

{\centering\begin{tabular}{|c|c|}
\hline 
\textbf{Text A:} & \textbf{Text B:} \\ 
\hline 
\parbox[t]{.45\textwidth}{\centering ``Lorem ipsum dolor sit amet, 
consectetuer adipiscing elit, sed diam 
nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat 
volutpat.''} & 
\parbox[t]{.45\textwidth}{\centering``Lorem ipsum dolor sit amet, 
consectetuer adipiscing elit, sed diam 
nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat 
volutpat.''}  \\ 
\hline 
\end{tabular}\par}

Without lines:

{\centering\begin{tabular}{cc}
\textbf{Text A:} & \textbf{Text B:} \\ 
\parbox[t]{.45\textwidth}{\centering ``Lorem ipsum dolor sit amet, 
consectetuer adipiscing elit, sed diam 
nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat 
volutpat.''} & 
\parbox[t]{.45\textwidth}{\centering``Lorem ipsum dolor sit amet, 
consectetuer adipiscing elit, sed diam 
nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat 
volutpat.''}  \\ 
\end{tabular}\par}
\end{document}

在此处输入图片描述


编辑以显示如何根据 OP 的要求使顶部框局部超出边距。我将其放置在 中以实现此目的\makebox[\textwidth]{...},并记住。边距范围显示在页面顶部的 中。\noindent\makebox\hrulefill

\documentclass[a4paper,12pt,oneside]{article}
\usepackage[english]{babel}
\usepackage{tikz}
\usepackage{pgf}
%\usetikzlibrary{shapes,arrows,positioning,calc,threeparttable} 
\usepackage{tabu}
\usepackage{hyperref}
\usepackage{longtable}
\usepackage{array}
\usepackage{multirow,tabularx,booktabs}
\parskip 1em
\begin{document}
\noindent\hrulefill

Footnotesize with margins exceeded to get specified text layout

\noindent\makebox[\textwidth]{\footnotesize\begin{tabular}{cc}
\textbf{Text A:} & \textbf{Text B:} \\ 
\parbox[t]{.6\textwidth}{\centering ``Lorem ipsum dolor sit amet, 
consectetuer adipiscing elit, sed diam 
nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat 
volutpat.''} & 
\parbox[t]{.6\textwidth}{\centering``Lorem ipsum dolor sit amet, 
consectetuer adipiscing elit, sed diam 
nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat 
volutpat.''}  \\ 
\end{tabular}}

Normalsize

{\centering\begin{tabular}{|c|c|}
\hline 
\textbf{Text A:} & \textbf{Text B:} \\ 
\hline 
\parbox[t]{.45\textwidth}{\centering ``Lorem ipsum dolor sit amet, 
consectetuer adipiscing elit, sed diam 
nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat 
volutpat.''} & 
\parbox[t]{.45\textwidth}{\centering``Lorem ipsum dolor sit amet, 
consectetuer adipiscing elit, sed diam 
nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat 
volutpat.''}  \\ 
\hline 
\end{tabular}\par}

Without lines:

{\centering\begin{tabular}{cc}
\textbf{Text A:} & \textbf{Text B:} \\ 
\parbox[t]{.45\textwidth}{\centering ``Lorem ipsum dolor sit amet, 
consectetuer adipiscing elit, sed diam 
nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat 
volutpat.''} & 
\parbox[t]{.45\textwidth}{\centering``Lorem ipsum dolor sit amet, 
consectetuer adipiscing elit, sed diam 
nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat 
volutpat.''}  \\ 
\end{tabular}\par}
\end{document}

在此处输入图片描述

相关内容