
我正在建立以下表格。該表應使用鋼筆或鉛筆手動填寫。但是每行中可用的空間是有限的(垂直)。如何增加列之間的垂直空間
\documentclass[a4paper]{exam}
\usepackage{multicol, setspace}
\usepackage{textcomp, booktabs,colortbl}
\usepackage[table]{xcolor}
\setlength\columnsep{10pt}
\onehalfspacing
\begin{document}
\begin{center}
\fbox{\fbox{\parbox{5.5in}{\centering
OPD ENCOUNTER FORM}}}
\end{center}
\vspace{0.1in}
\makebox[\textwidth]{Name :\enspace\hrulefill}
\begin{multicols}{2}
\vspace{0.2in}
\makebox[0.45\textwidth]{Age:\enspace\hrulefill}
\makebox[0.5\textwidth]{Sex:\enspace\hrulefill}
\end{multicols}
\makebox[\textwidth]{Address:\enspace\hrulefill}
\begin{multicols}{2}
\makebox[0.45\textwidth]{Dated: \enspace\hrulefill}
\makebox[0.45\textwidth]{Ref: \enspace\hrulefill}
\end{multicols}
%-----------------------------------------------------------
\section*{Present Problem}
\fillwithlines{0.5in}
%----------------------------------------------------------
\section*{\large \textrecipe}
\begin{table}[htp]
\rowcolors{2}{gray!25}{white}
\begin{tabular}{c p{3cm}p{3cm}clc}
\toprule
Sr No & Drug & Dose & Frequency & Duration & Remark \\ \midrule
1 & & & -~~ -~~ - & x & before/with/after meals, at night \\
2 & & & -~~ -~~ - & x & before/with/after meals, at night \\
3 & & & -~~ -~~ - & x & before/with/after meals, at night \\
4 & & & -~~ -~~ - & x & before/with/after meals, at night \\
5 & & & -~~ -~~ - & x & before/with/after meals, at night \\
6 & & & -~~ -~~ - & x & before/with/after meals, at night \\
7 & & & -~~ -~~ - & x & before/with/after meals, at night \\ \bottomrule
\end{tabular}
\end{table}
\end{document}
答案1
您可以使用\renewcommand{\arraystretch}{2}
。2
例如,根據需要進行更改3
。
\documentclass[a4paper]{exam}
\usepackage{multicol, setspace}
\usepackage{textcomp, booktabs,colortbl}
\usepackage[table]{xcolor}
\setlength\columnsep{10pt}
\onehalfspacing
\begin{document}
\begin{center}
\fbox{\fbox{\parbox{5.5in}{\centering
OPD ENCOUNTER FORM}}}
\end{center}
\vspace{0.1in}
\makebox[\textwidth]{Name :\enspace\hrulefill}
\begin{multicols}{2}
\vspace{0.2in}
\makebox[0.45\textwidth]{Age:\enspace\hrulefill}
\makebox[0.5\textwidth]{Sex:\enspace\hrulefill}
\end{multicols}
\makebox[\textwidth]{Address:\enspace\hrulefill}
\begin{multicols}{2}
\makebox[0.45\textwidth]{Dated: \enspace\hrulefill}
\makebox[0.45\textwidth]{Ref: \enspace\hrulefill}
\end{multicols}
%-----------------------------------------------------------
\section*{Present Problem}
\fillwithlines{0.5in}
%----------------------------------------------------------
\section*{\large \textrecipe}
\begin{table}[htp]
\rowcolors{2}{gray!25}{white}
\renewcommand{\arraystretch}{3}
\begin{tabular}{c p{3cm}p{3cm}clc}
\toprule
Sr No & Drug & Dose & Frequency & Duration & Remark \\ \midrule
1 & & & -~~ -~~ - & x & before/with/after meals, at night \\
2 & & & -~~ -~~ - & x & before/with/after meals, at night \\
3 & & & -~~ -~~ - & x & before/with/after meals, at night \\
4 & & & -~~ -~~ - & x & before/with/after meals, at night \\
5 & & & -~~ -~~ - & x & before/with/after meals, at night \\
6 & & & -~~ -~~ - & x & before/with/after meals, at night \\
7 & & & -~~ -~~ - & x & before/with/after meals, at night \\ \bottomrule
\end{tabular}
\end{table}
\end{document}
答案2
\\
另一種方法是在每行替換為後手動指定所需的跳過\\[skip]
。
透過這種方式,您甚至可以區分每一行的跳過。
例如,在下面的 MWE 中,我5ex
在每個白色行和7ex
每個灰色行之後給出:
\documentclass[a4paper]{exam}
\usepackage{multicol, setspace}
\usepackage{textcomp, booktabs,colortbl}
\usepackage[table]{xcolor}
\setlength\columnsep{10pt}
\onehalfspacing
\begin{document}
\begin{center}
\fbox{\fbox{\parbox{5.5in}{\centering
OPD ENCOUNTER FORM}}}
\end{center}
\vspace{0.1in}
\makebox[\textwidth]{Name :\enspace\hrulefill}
\begin{multicols}{2}
\vspace{0.2in}
\makebox[0.45\textwidth]{Age:\enspace\hrulefill}
\makebox[0.5\textwidth]{Sex:\enspace\hrulefill}
\end{multicols}
\makebox[\textwidth]{Address:\enspace\hrulefill}
\begin{multicols}{2}
\makebox[0.45\textwidth]{Dated: \enspace\hrulefill}
\makebox[0.45\textwidth]{Ref: \enspace\hrulefill}
\end{multicols}
%-----------------------------------------------------------
\section*{Present Problem}
\fillwithlines{0.5in}
%----------------------------------------------------------
\section*{\large \textrecipe}
\begin{table}[htp]
\rowcolors{2}{gray!25}{white}
\begin{tabular}{c p{3cm}p{3cm}clc}
\toprule
Sr No & Drug & Dose & Frequency & Duration & Remark \\ \midrule
1 & & & -~~ -~~ - & x & before/with/after meals, at night \\[5ex]
2 & & & -~~ -~~ - & x & before/with/after meals, at night \\[7ex]
3 & & & -~~ -~~ - & x & before/with/after meals, at night \\[5ex]
4 & & & -~~ -~~ - & x & before/with/after meals, at night \\[7ex]
5 & & & -~~ -~~ - & x & before/with/after meals, at night \\[5ex]
6 & & & -~~ -~~ - & x & before/with/after meals, at night \\[7ex]
7 & & & -~~ -~~ - & x & before/with/after meals, at night \\[5ex] \bottomrule
\end{tabular}
\end{table}
\end{document}
輸出: