表格中的行距问题

表格中的行距问题

在下面的代码中,描述了一个表格。第二条水平线似乎与文本行混淆了。

我该如何改正?

黄色高亮部分

那么问题是:如何增加行和文本之间的行距?

 \resheading{\textbf{ACADEMIC DETAILS} }\\[\lsep]
\vspace{5mm} \vfill
%\begin{table}[ht!]
%\begin{center}
\indent \begin{tabular}{ l @{\hskip 0.15in} l @{\hskip 0.20in} l @{\hskip 0.20in} l @{\hskip 0.20in} l }
\hline
\vspace{0.1mm}
\textbf{Year} &\textbf{Degree} & \textbf{Institute}   & \textbf{CGPA/\%} \\
\hline
2015- Present&B.Tech Electrical and Electronics Engineering & VIT Vellore  & 9.69 CGPA \\

2015 & 12th CBSE Board Examination & Kendriya Vidyalaya & 94.8\%\\

2013 & 10th CBSE Board Examination & Kendriya Vidyalaya & 10 CGPA\\
\hline
\end{tabular}
%\end{center}
%\end{table}
\vspace{2mm}

%\resheading{\textbf

答案1

另一个解决方案是定义一个最小使用以下包在单元格顶部和底部添加垂直填充cellspace

\documentclass{article}

\usepackage[top=0.75in, bottom=0.75in, left=0.55in, right=0.85in]{geometry}

\usepackage{booktabs}
\usepackage{cellspace}
\setlength\cellspacetoplimit{4pt}
\setlength\cellspacebottomlimit{4pt}

\begin{document}

\centering
    \begin{tabular}{@{}*{4}{Sl}@{}}
        \toprule
        \textbf{Year} &\textbf{Degree} & \textbf{Institute} & \textbf{CGPA/\%}\\
        \midrule
        2015 -- present & B.Tech Electrical and Electronics Engineering & VIT Vellore & 9.69 CGPA\\
        2015 & 12th CBSE Board Examination & Kendriya Vidyalaya & 94.8\%\\
        2013 & 10th CBSE Board Examination & Kendriya Vidyalaya & 10 CGPA\\
        \bottomrule
    \end{tabular}

\end{document} 

在此处输入图片描述

答案2

作为Alan Munn 也在他的评论中建议:不要担心,让我们来booktabs解决你的问题:

\documentclass{article}

\usepackage[top=0.75in, bottom=0.75in, left=0.55in, right=0.85in]{geometry}

\usepackage{booktabs}
\usepackage{tabularx}

\begin{document}

    \begin{tabularx}{\dimexpr\linewidth-15pt}{@{}lXll@{}}
        \toprule
        \textbf{Year} &\textbf{Degree} & \textbf{Institute} & \textbf{CGPA/\%}\\
        \midrule
        2015 -- present & B.Tech Electrical and Electronics Engineering & VIT Vellore & 9.69 CGPA\\
        2015 & 12th CBSE Board Examination & Kendriya Vidyalaya & 94.8\%\\
        2013 & 10th CBSE Board Examination & Kendriya Vidyalaya & 10 CGPA\\
        \bottomrule
    \end{tabularx}

\end{document}

在此处输入图片描述

答案3

像这样?

在此处输入图片描述

正如建议的那样艾伦·芒恩在他的评论中,包中的规则为booktabs单元格内容提供了更多的垂直空间。除此之外,还\arraystretch增加并删除了列之间多余的手动间距。

{\renewcommand\arraystretch{1.2}
\begin{tabular}{ l l l l l }
\midrule
\textbf{Year} 
     & \textbf{Degree}  & \textbf{Institute}   & \textbf{CGPA/\%}   \\
\midrule
2015- Present
     & B.Tech Electrical and Electronics Engineering  
                        & VIT Vellore           & 9.69 CGPA         \\

2015 & 12th CBSE Board Examination 
                        & Kendriya Vidyalaya    & 94.8\%            \\

2013 & 10th CBSE Board Examination 
                        & Kendriya Vidyalaya    & 10 CGPA           \\
\midrule
\end{tabular}
}

相关内容