I am using document class elsarticle for drawing a table which should be both columns wide like But my table is not going as wide, also how to shift table caption to left like shown in this figure. plz, guide. I am using the following code.
\documentclass[final, 5p, times, twocolumn]{elsarticle}
%\documentclass[times]{elsarticle}
\journal{Nuclear Physics B}
\usepackage{graphicx}
\usepackage{multirow}
\usepackage{fullpage}
\usepackage{tabularx}
\usepackage{booktabs}
\usepackage{hyperref}
\begin{document}
\begin{table*}[h]
\caption{Confusion Matrix for EmoDB Datset}
\begin{tabular}{l c c c c c cc}
\hline
&angry&boredom&disgust&fear&happy&sadness&neutral\\
\hline
angry&\textbf{0.96}&0.00&0.00&0.01&0.03&0.00&0.00\\
boredom&0.00&\textbf{0.92}&0.00&0.01&0.00&0.02&0.05\\
disgust&0.00&0.00&\textbf{100}&0.00&0.00&0.00&0.00\\
fear&0.00&0.00&0.00&\textbf{0.93}&0.02&0.00&0.05\\
happy&0.08&0.00&0.00&0.00&\textbf{0.90}&0.00&0.02\\
sadness&0.00&0.00&0.00&0.00&0.00&\textbf{100}&0.00\\
neutral&0.00&0.06&0.00&0.00&0.00&0.03&\textbf{0.91}\\
\hline
\end{tabular}
\end{table*}
\end{document}
Best Answer
I guess, you're interested in stretching the table from its natural width, that it currently has, to the entire linewidth. For this you could use
tabular*
in combination with\extracolsep{\fill}}
. Since the table then contains a huge amount of wastes white space which does not really make the table more readable, I included an alternative layout that easily fits into one of the two document columns: