这个乳胶代码有什么问题?

这个乳胶代码有什么问题?

请帮助我,我正在尝试嵌套表格。

\begin{center}
\begin{tabular}{|p{2.5cm}|p{6.0cm}|p{8.5cm}|p{1.8cm}|}
\hline
\centering{\textbf{Year}} & \centering{\textbf{Degree/Certificate}} & \centering{\textbf{Institute}} & \textbf{CPI/$\%$}\\
\hline
\centering{2017} - Present & \begin{tabular}{c}\hline \centering{B.Tech : BSBE} \\ \hline \centering{M.Sc : MTH}\\ \end{tabular}  & \centering{Indian Institute of Technology, Kanpur} & 9.8/10\\
\hline
\centering{2017} & \centering{CBSE(\Romannum{12})} & \centering{Aklank Public School, Kota} & 91.2$\%$\\
\hline
\centering{2015} & \centering{ICSE(\Romannum{10})} & \centering{Saint Francis School, Jasidih} & 97$\%$\\
\hline
\end{tabular}
\end{center}

答案1

这是一个经过简化的解决方案,使用最新版本和包w定义的列类型。请注意,对于单元格中的文本来说,列宽非常大,我不得不使用选项来设置几何。您应该看看给定的尺寸是否真的有必要。arraymakecellloada3paper

\documentclass{article}
\usepackage{romannum}
\usepackage{array, makecell}
\usepackage[a3paper]{geometry}
\usepackage{makecell, hhline, multirow}
\renewcommand{\theadfont}{\normalsize\bfseries}

\begin{document}

\begin{center}
\setcellgapes{3pt}\makegapedcells
\begin{tabular}{|w{c}{2.5cm}|w{c}{6.0cm}|w{c}{8.5cm}|p{1.8cm}|}
\hline
\textbf{Year} & \textbf{Degree/Certificate} & \textbf{Institute} & \textbf{CPI/\%}\\
\hline
2017 -- Present & \makecell{ B.Tech : BSBE \\\hline\noalign{\vspace{2pt}} M.Sc : MTH} & Indian Institute of Technology, Kanpur & 9.8/10\\
\hline
2017 & CBSE(\Romannum{12}) & Aklank Public School, Kota & 91.2\,\%\\
\hline
2015 & ICSE(\Romannum{10}) & Saint Francis School, Jasidih & 97\,\%\\
\hline
\end{tabular}
\end{center}

\end{document} 

在此处输入图片描述

答案2

由于未定义而删除了 romanum——看看它是否满足你的要求

在此处输入图片描述

\begin{tabular}{|>{\centering\arraybackslash}m{1in}|>{\centering\arraybackslash}m{1.5in}|>{\centering\arraybackslash}m{2in}|>{\centering\arraybackslash}m{1in}|}
    \hline
    Year & 
    Degree/Certificate & 
    Institute & 
    CPI/$\%$\\
    \hline
    2017 - Present & 
    B.Tech    & 
    Indian Institute of Technology, Kanpur & 
    9.8/10\\
    
    &BSBE M.Sc : MTH&&\\\hline
    2017 & 
    CBSE({12}) & 
    Aklank Public School, Kota & 
    91.2$\%$\\
    \hline
    2015 & 
    ICSE({10}) & 
    Saint Francis School, Jasidih & 
    97$\%$\\
    \hline
\end{tabular}

相关内容