\documentclass[12pt]{article}
\usepackage{amsmath,amssymb}
\usepackage[table]{xcolor}
\usepackage{tabularx}
\usepackage{makecell}
\usepackage{graphicx}
\usepackage{accents}
\begin{document}
\begin{table}[h]
\centering
\scalebox{2}{
\begin{tabular}{|c|c|c|c|}
\hline
Standard & University & Board & Class\\
\hline
$\overline{\underline{XII}}^{th}$ & ABC & IIP & $\overline{\underline{II}}^{nd}$\\
\hline
\end{tabular}}
\end{table}
\end{document}
答案1
您无需重新发明轮子,而是可以使用该romanbar
包来书写带有上下横线的罗马数字:
\documentclass[12pt]{article}
\usepackage{romanbar}
\begin{document}
\begin{table}[h]
\centering
\begin{tabular}{|c|c|c|c|}
\hline
Standard & University & Board & Class\\
\hline
\Romanbar{12}\textsuperscript{th} & ABC & IIP & \Romanbar{2}\textsuperscript{nd}\\
\hline
\end{tabular}
\end{table}
\end{document}