테이블 열의 세로 공간

테이블 열의 세로 공간

다음과 같은 양식을 만들고 있습니다. 테이블은 펜이나 ​​연필을 사용하여 수동으로 채워야 합니다. 그러나 각 라인에서 사용할 수 있는 공간은 제한되어 있습니다(수직). 열 사이의 수직 공간을 늘리려면 어떻게 해야 합니까?

\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].

이런 방식으로 각 행의 건너뛰기를 구별할 수도 있습니다.

5ex예를 들어, 다음 MWE에서는 각 흰색 행과 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} 

산출:

여기에 이미지 설명을 입력하세요

관련 정보