如何删除表格右侧的空白

如何删除表格右侧的空白

我是第一次使用 Latex 制作表格,我不知道如何修复表格右侧的空白。如有任何帮助我将不胜感激。

在此处输入图片描述

我正在使用以下代码:

\documentclass{article}
\usepackage{colortbl}
\definecolor{Lightgray}{RGB}{235,235,235}
\usepackage{xcolor,colortbl}
\usepackage{multirow}
\usepackage{booktabs,nicematrix}

\newcommand{\mc}[2]{\multicolumn{#1}{|c|}{#2}}
\definecolor{Gray}{gray}{0.85}
\definecolor{LightCyan}{rgb}{0.88,1,1}
\newcolumntype{a}{>{\columncolor{Gray}}c}
\newcolumntype{b}{>{\columncolor{white}}c}

\begin{document}
\begin{table*}[!htpb]
\caption{Regret upper bound for episodic, non-stationary, linear
MDPs.
\label{table:bounds}}
\begin{center}
\begin{small}
\begin{tabular}{l  a  b  a  b}
\hline
\rowcolor{LightCyan}&&&Computational&\\
\rowcolor{LightCyan}\multirow{-2}{*}{Algorithm}& \multirow{-2}{*}{Regret} & \multirow{-2}{*}{Exploration} & Tractability \\ \hline
LSVI-UCB  & $\Tilde{\mathcal{O}}(d^{3/2} H^{3/2} \sqrt{T} )$ &  UCB & Yes \\ \hline
OPT-RLSVI  & $\Tilde{\mathcal{O}}(d^2 H^2 \sqrt{T} )$ &  TS & Yes\\ \hline

ELEANOR  & $\Tilde{\mathcal{O}}(dH^{3/2}\sqrt{T})$ & Optimism & No \\ \hline
LSVI-PHE  & $\Tilde{\mathcal{O}}(d^{3/2} H^{3/2} \sqrt{T})$ & TS & Yes \\\hline 
 (this paper) & $\Tilde{\mathcal{O}}(d^{3/2}H^{3/2}\sqrt{T})$ & LMC & Yes \\\hline 
\end{tabular}
\end{small}
\end{center}
\end{table*}
\end{document}

答案1

在下面的解决方案中,我添加了 makecell 包并将第一行重写为

\documentclass{article}
\usepackage{colortbl}
\definecolor{Lightgray}{RGB}{235,235,235}
\usepackage{xcolor,colortbl}
\usepackage{multirow}
\usepackage{booktabs,nicematrix}

\newcommand{\mc}[2]{\multicolumn{#1}{|c|}{#2}}
\definecolor{Gray}{gray}{0.85}
\definecolor{LightCyan}{rgb}{0.88,1,1}
\newcolumntype{a}{>{\columncolor{Gray}}c}
\newcolumntype{b}{>{\columncolor{white}}c}
\usepackage{makecell} % Addition of makecell

\begin{document}
\begin{table*}[!htpb]
\caption{Regret upper bound for episodic, non-stationary, linear
MDPs.
\label{table:bounds}}
\begin{center}
\begin{small}
\begin{tabular}{l  a  b  a  b}
\hline
\rowcolor{LightCyan}
Algorithm & Regret & Exploration & \makecell[c]{Computational\\Tractability} & \\ \hline % Rewrote first line
LSVI-UCB  & $\Tilde{\mathcal{O}}(d^{3/2} H^{3/2} \sqrt{T} )$ &  UCB & Yes \\ \hline
OPT-RLSVI  & $\Tilde{\mathcal{O}}(d^2 H^2 \sqrt{T} )$ &  TS & Yes\\ \hline

ELEANOR  & $\Tilde{\mathcal{O}}(dH^{3/2}\sqrt{T})$ & Optimism & No \\ \hline
LSVI-PHE  & $\Tilde{\mathcal{O}}(d^{3/2} H^{3/2} \sqrt{T})$ & TS & Yes \\\hline 
 (this paper) & $\Tilde{\mathcal{O}}(d^{3/2}H^{3/2}\sqrt{T})$ & LMC & Yes \\\hline 
\end{tabular}
\end{small}
\end{center}
\end{table*}
\end{document}

在此处输入图片描述

相关内容