文档中的一个表格让我很为难。我添加了以下 MWE,问题出在第二列最后一个单元格和第三列。尽管我使用了“X”,但问题仍然存在。
\documentclass[journal]{IEEEtran}
\usepackage{graphicx}
\usepackage{cite}
\usepackage[cmex10]{amsmath}
\usepackage[utf8]{inputenc}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{tabularx}
\usepackage[acronym]{glossaries}
\IEEEoverridecommandlockouts
\usepackage[ruled,longend,linesnumbered]{algorithm2e}
\SetArgSty{textup}
\SetKwBlock{Loop}{Loop}{end}
\usepackage{physics}
\usepackage{lscape}
\usepackage{xcolor}
\usepackage{array}\usepackage{makecell}
\usepackage{multirow}
\usepackage{pbox}
\usepackage{amssymb}
\usepackage{stackengine}
\usepackage{makecell}
\usepackage{siunitx}
\usepackage{float}
\usepackage{amsmath,mathtools}
\begin{document}
\begin{table*}[t]
\caption{}
\renewcommand{\arraystretch}{1.39}
\setlength{\tabcolsep}{2.5pt}
\label{} %cXXX {\linewidth}
\begin{tabularx} {\textwidth} {|c|p{4cm}| p{5cm}|X|}
\hline
\multicolumn{1}{|c}{Ref.(s)}& \multicolumn{1}{|c}{Method(s)} & \multicolumn{1}{|c}{Contribution(s)} & \multicolumn{1}{|c|}{Remark(s)}
%& &PV & ESS & &Selling & Buying &Transactions & & p{6.5cm}
\\
\hline
[11], [12]& \lipsum[1][1-2] & QoS
guarantees, peak shaving and efficient resource allocation &\multirow[t]{3}{6.5cm}{{\lipsum[1][1-12] }} \\ \cline{1-3} %\cline{4-5}
%\hline
[13], [14]
&\lipsum[1][1-2] & \lipsum[1][1-3] & \\ \cline{1-3}
[15], [16] & \lipsum[1][1-2]
& \lipsum[1][1] & \\\cline{1-3}
%\hline
[17], [18]& \lipsum[1][1-2] & \lipsum[1][1] & \\ \hline
\textit{Our work}&\lipsum[1][1] &\multirow[t]{3}{5cm}{{\lipsum[1][1-6] }} &\multirow[t]{5}{7cm}{{\lipsum[1][1-8]}} \\
&&& \\
&&& \\
&&& \\
&&& \\
&&& \\
\hline
\end{tabularx}
\end{table*}
\end{document}
答案1
像这样?
\documentclass[journal]{IEEEtran}
\usepackage{xcolor}
\usepackage{multirow, tabularx}
\newcolumntype{Y}[1]{>{\hsize=#1\hsize\linewidth=\hsize%
\hspace{0pt}}X}
\usepackage{tabularray}
\usepackage{microtype}
\usepackage{lipsum}
\begin{document}
\begin{table*}
\setlength\tabcolsep{3pt}
\renewcommand\arraystretch{1.39}
\caption{With \texttt{tabularx}}
\label{tab:?}
\begin{tabularx}{\linewidth}{|l | Y{0.9} | Y{0.9} | Y{1.2}| }
\hline
Ref.(s)
& Method(s)
& Contribution(s)
& Remark(s) \\
%
\hline
[11], [12]
& \lipsum[1][1-2]
& QoS guarantees, peak shaving and efficient resource allocation
& \multirow{4}{=}{\lipsum[1][1-12]} \\
\cline{1-3}
[13], [14]
& \lipsum[1][1-2]
& \lipsum[1][1-3]
& \\
\cline{1-3}
[15], [16]
&\lipsum[1][1-2]
& \lipsum[1][1-3]
& \\
\cline{1-3}
[17], [18]
& \lipsum[1][1-2]
& \lipsum[1][1]
& \\
\hline
\textit{Our work}
& \lipsum[1][1]
& \lipsum[1][1-6]
& \lipsum[1][1-8] \\
\hline
\end{tabularx}
\end{table*}
\begin{table*}
\caption{With \texttt{tabularray}}
\label{tab:??}
\begin{tblr}{hlines, vlines,
colspec = {Q[l] X[0.9, j] X[0.9, j] X[1.2, j]},
colsep = 3pt,
row{1} = {font=\bfseries, c}
}
Ref.(s)
& Method(s)
& Contribution(s)
& Remark(s) \\
%
{[11], [12]}
& \lipsum[1][1-2]
& QoS guarantees, peak shaving and efficient resource allocation
& \SetCell[r=4]{h} \lipsum[1][1-12] \\
{[13], [14]}
& \lipsum[1][1-2]
& \lipsum[1][1-3]
& \\
{[15], [16]}
& \lipsum[1][1-2]
& \lipsum[1][1-3]
& \\
{[17], [18]}
& \lipsum[1][1-2]
& \lipsum[1][1]
& \\
\textit{Our work}
& \lipsum[1][1]
& \lipsum[1][1-6]
& \lipsum[1][1-8] \\
\end{tblr}
\end{table*}
\end{document}