我想要得到两条并排的水平线,如图所示

我想要得到两条并排的水平线,如图所示
\documentclass[12pt, a4paper]{article}
\usepackage{booktabs}
\begin{document}
I want them on the same row, side by side. 

\vspace{0.5cm}
\begin{tabular}[t]{@{}p{0.45\textwidth}@{}}
\toprule
Supervisor\\
Name of the Supervisor\\
Title, Affiliation\\
Head of Department\\
Department of Electronics and Computer Engineering\\
\end{tabular}
\hfill
\begin{tabular}[t]{@{}p{0.45\textwidth}@{}}
\toprule
Internal Examiner\\
Name of Internal Examiner\\
Title, Affiliation\\
\end{tabular}
\vspace{0.5cm}
\begin{tabular}[t]{@{}p{0.45\textwidth}@{}}
\toprule
Supervisor\\
Name of the Supervisor\\
Title, Affiliation\\
Head of Department\\
Department of Electronics and Computer Engineering\\
\end{tabular}
\hfill
\begin{tabular}[t]{@{}p{0.45\textwidth}@{}}
\toprule
Internal Examiner\\
Name of Internal Examiner\\
Title, Affiliation\\
\end{tabular}
\end{document}

在此处输入图片描述

答案1

使用两个tabulars

\documentclass[12pt, a4paper]{article}
\usepackage{booktabs,array}
\begin{document}
I want them on the same row, side by side.

\vspace{0.5cm}
\begin{tabular}[t]{@{}>{\raggedright\arraybackslash}p{0.45\textwidth}@{}}
\toprule
Supervisor\\
Name of the Supervisor\\
Title, Affiliation\\
Head of Department\\
Department of Electronics and Computer Engineering\\
\end{tabular}
\hfill
\begin{tabular}[t]{@{}>{\raggedright\arraybackslash}p{0.45\textwidth}@{}}
\toprule
Internal Examiner\\
Name of Internal Examiner\\
Title, Affiliation\\
\end{tabular}
\end{document}

在此处输入图片描述

我使用了booktabs以便\toprule可以自定义线条(例如,\toprule[1pt]1pt 粗线)。如果您不需要,请使用\hlinewithout booktabs

要添加更多内容,您必须留出一个空行(相当于一个新段落)。

\documentclass[12pt, a4paper]{article}
\usepackage{booktabs}
\begin{document}
I want them on the same row, side by side.

\vspace{0.5cm}
\begin{tabular}[t]{@{}p{0.45\textwidth}@{}}
\toprule
Supervisor\\
Name of the Supervisor\\
Title, Affiliation\\
Head of Department\\
Department of Electronics and Computer Engineering\\
\end{tabular}
\hfill
\begin{tabular}[t]{@{}p{0.45\textwidth}@{}}
\toprule
Internal Examiner\\
Name of Internal Examiner\\
Title, Affiliation\\
\end{tabular}

\vspace{0.5cm}
\begin{tabular}[t]{@{}p{0.45\textwidth}@{}}
\toprule
Supervisor\\
Name of the Supervisor\\
Title, Affiliation\\
Head of Department\\
Department of Electronics and Computer Engineering\\
\end{tabular}
\hfill
\begin{tabular}[t]{@{}p{0.45\textwidth}@{}}
\toprule
Internal Examiner\\
Name of Internal Examiner\\
Title, Affiliation\\
\end{tabular}
\end{document}

在此处输入图片描述

答案2

或者,使用两个minipage也可以。

在此处输入图片描述

代码

\documentclass[12pt, a4paper]{article}
\begin{document}
I want them on the same row, side by side. 
\vspace{0.5cm}

\begin{minipage}[t]{0.45\textwidth}
\line(1,0){150}\\
Supervisor\\
Name of the Supervisor\\
Title, Affiliation\\
Head of Department\\
Department of Electronics \\ and Computer Engineering\\
\end{minipage}\hfill
\begin{minipage}[t]{0.45\textwidth}
\line(1,0){150}\\
Internal Examiner\\
Name of Internal Examiner\\
Title, Affiliation\\    
\end{minipage}

\begin{minipage}[t]{0.45\textwidth}
\line(1,0){150}\\
Supervisor\\
Name of the Supervisor\\
Title, Affiliation\\
Head of Department\\
Department of Electronics \\ and Computer Engineering\\
\end{minipage}\hfill
\begin{minipage}[t]{0.45\textwidth}
\line(1,0){150}\\
Internal Examiner\\
Name of Internal Examiner\\
Title, Affiliation\\    
\end{minipage}
\end{document}

相关内容