我有一个简单的例子,运行良好,但自从重新安装 MikTeX 以来,我无法再将 A 置于单元格的中间
\newcolumntype{C}{ >{\centering\arraybackslash} m{0.5\textwidth} }
\begin{tabular}{|C|}
\hline
A\\[50pt]
\hline
\end{tabular}
并且 MWE 更加完整:
\documentclass[10pt,a4paper]{article}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{array}
\begin{document}
\newcolumntype{C}{ >{\centering\arraybackslash} m{0.45\textwidth} }
\newcolumntype{D}{ >{\centering\arraybackslash} m{0.45\textwidth} }
\begin{tabular}{|C|D|@{}m{0pt}@{}}
\hline
A & B & \\[10pt]
\hline
\begin{itemize}
\item bla
\item bla
\item bla
\end{itemize} &
\begin{tabular}{cc}
a & b \\
c & d \\
e & f
\end{tabular}
\\ \hline
\end{tabular}
\end{document}
是不是有什么变化了,还是我哪里搞错了?提前谢谢大家。
答案1
我会按如下方式重新格式化您的表格(不过,我不确定您想要什么):
\documentclass[10pt,a4paper]{article}
\usepackage{enumitem}
\usepackage{ragged2e} % <---
\usepackage{array, makecell}
\renewcommand\theadfont{\normalsize\bfseries} % <---
\newcolumntype{L}[1]{ >{\csname @minipagetrue\endcsname% <---
\RaggedRight\hspace{0pt}}m{#1} }
\begin{document}
\begin{table}[ht]
\centering
\setlist[itemize]{nosep, % <--- list setup
leftmargin=*,
label=\textbullet,
before=\vspace{-0.6\baselineskip},
after =\vspace{-0.6\baselineskip}
}
\begin{tabular}{| L{0.45\linewidth} | L{0.45\linewidth}|}
\hline
\thead{A} & \thead{B} \\
\hline
\begin{itemize}
\item bla
\item bla
\item bla
\end{itemize} & \vspace{-0.6\baselineskip}% <---
\begin{tabular}{@{} cc @{}}
a & b \\
c & d \\
e & f
\end{tabular} \\
\hline
\end{tabular}
\end{table}
\end{document}
答案2
快速而肮脏的技巧:
\documentclass[10pt,a4paper]{article}
\usepackage{array,xcolor}
\begin{document}
\color{gray!50}
1
2
3 --- --- --- --- --->
4
5
\color{black}
\vspace{-5\baselineskip}
\newcolumntype{C}{ >{\centering\arraybackslash}m{0.45\textwidth}}
\begin{tabular}{|C|C|}
\hline
\rule[-25.5pt]{0em}{60pt} A & \rule[-25.5pt]{0em}{60pt} B \\
\hline
\begin{itemize}
\item bla
\item bla
\item bla
\end{itemize} & \renewcommand\arraystretch{1}
\begin{tabular}{cc}
a & b \\
c & d \\
e & f
\end{tabular} \\ \hline
\end{tabular}
\end{document}