1

I am new to making table in latex and I am not sure how to fix this white space in the right of the table. Any help would be appreciated.

enter image description here

I am using the following code:

\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 Answer 1

1

In the solution below, I added the package makecell and rewrote the first line as

\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}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .