0

I have been trying to justify the text I have above all of my tables, but to no avail. Initially, I used the \begin{flushleft} which was a bad solution, since it left aligned the text and made it look like this:

enter image description here

which does not justify the text to span it to the right text margin. I also tried using the \begin{justification} environment, which did not help either, as it seemed to just center the text. How can I justify the text, so it mathes the text margins? I posted my code as MWE below:

\usepackage[table,xcdraw]{xcolor}
\usepackage{booktabs}
\usepackage{subcaption}
\usepackage[labelfont=bf]{caption}
\captionsetup{labelfont=bf}

\documentclass{article}

\begin{document}

\begin{table}[h]
\centering
\caption{Valuation errors by the combinatorial selection schemes for the S\&P sub-indices}
\label{Results.Robustness.FirmSize}
\begin{flushleft} This table reports the median and arithmetic mean of the absolute percentage errors generated by the two combinatorial peer selection schemes SBP\Plus SARD and GICS\Plus SARD, for constituents of the S\&P 500, 400 and 600 indices. The median and arithmetic mean of the pairwise valuation error differences are statistically tested through the Wilcoxon signed rank test and Student's t-test, respectively. Each combinatorial selection scheme has used the EV/EBITDA, EV/EBIT and P/E multiple to value a target firm. A positive pairwise median difference indicates that the SBP\Plus SARD generates a higher valuation accuracy, relative to GICS\Plus SARD, and vice versa. Statistical significance is denoted by *, **, *** indicating 10\%, 5\% and 1\% respectively. \\ 
\end{flushleft} \vspace{0.2cm}
\begin{tabular}{|lccc|}
\hline
\rowcolor[HTML]{003085} 
{\color[HTML]{FFFFFF} \textbf{S\&P 500}} & {\color[HTML]{FFFFFF} \textbf{Median}} & {\color[HTML]{FFFFFF} \textbf{Mean}} & {\color[HTML]{FFFFFF} \textbf{IQ range}} \\
\textbf{EV/EBITDA} &  &  &  \\
GICS+SARD & 25.1\% (2) & 31.5\% (2) & 34.2\% (2) \\
SBP+SARD & 20.7\% (1) & 27.9\% (1) & 27.4\% (1) \\
Pairwise difference & \textbf{4.2\%***} & \textbf{3.5\%***} &  \\
\textbf{EV/EBIT} &  &  &  \\
GICS+SARD & 23.7\% (2) & 29.6\% (2) & 31.4\% (2) \\
SBP+SARD & 20.5\% (1) & 27.5\% (1) & 28.2\% (1) \\
Pairwise difference & \textbf{2.5\%***} & \textbf{2.0\%***} &  \\
\textbf{P/E} &  &  &  \\
GICS+SARD & 30.5\% (2) & 42.2\% (2) & 45.6\% (2) \\
SBP+SARD & 27.7\% (1) & 39.2\% (1) & 41.2\% (1) \\
Pairwise difference & \textbf{3.3\%***} & \textbf{3.0\%***} &  \\
\rowcolor[HTML]{003085} 
{\color[HTML]{FFFFFF} \textbf{S\&P 400}} & {\color[HTML]{FFFFFF} \textbf{Median}} & {\color[HTML]{FFFFFF} \textbf{Mean}} & {\color[HTML]{FFFFFF} \textbf{IQ range}} \\
\textbf{EV/EBITDA} &  &  &  \\
GICS+SARD & 27.7\% (2) & 42.4\% (2) & 36.6\% (2) \\
SBP+SARD & 24.8\% (1) & 33.1\% (1) & 34.3\% (1) \\
Pairwise difference & \textbf{2.9\%***} & \textbf{10.3\%***} &  \\
\textbf{EV/EBIT} &  &  &  \\
GICS+SARD & 30.8\% (2) & 44.5\% (2) & 39.6\% (2) \\
SBP+SARD & 25.3\% (1) & 34.2\% (1) & 33.2\% (1) \\
Pairwise difference & \textbf{5.9\%***} & \textbf{2.0\%***} &  \\
\textbf{P/E} & \multicolumn{1}{l}{} & \multicolumn{1}{l}{} & \multicolumn{1}{l|}{} \\
GICS+SARD & \multicolumn{1}{l}{40.0\% (2)} & \multicolumn{1}{l}{52.6\% (2)} & \multicolumn{1}{l|}{55.7\% (2)} \\
SBP+SARD & \multicolumn{1}{l}{34.1\% (1)} & \multicolumn{1}{l}{48.9\% (1)} & \multicolumn{1}{l|}{45.9\% (1)} \\
Pairwise difference & \textbf{6.2\%***} & \textbf{3.6\%***} &  \\ \hline
\rowcolor[HTML]{003085} 
{\color[HTML]{FFFFFF} \textbf{S\&P 600}} & {\color[HTML]{FFFFFF} \textbf{Median}} & {\color[HTML]{FFFFFF} \textbf{Mean}} & {\color[HTML]{FFFFFF} \textbf{IQ range}} \\ \hline
\textbf{EV/EBITDA} &  &  & \multicolumn{1}{l|}{} \\
GICS+SARD & 28.2\% (2) & 40.0\% (2) & 36.1\% (2) \\
SBP+SARD & 24.6\% (1) & 31.3\% (1) & 32.1\% (1) \\
Pairwise difference & \textbf{3.9\%***} & \textbf{8.7\%***} &  \\
\textbf{EV/EBIT} &  &  &  \\
GICS+SARD & 27.1\% (2) & 36.3\% (2) & 36.3\% (2) \\
SBP+SARD & 25.3\% (1) & 31.7\% (1) & 33.9\% (1) \\
Pairwise difference & \textbf{2.7\%***} & \textbf{4.6\%***} &  \\
\textbf{P/E} &  &  &  \\
GICS+SARD & 33.4\% (2) & 45.6\% (2) & 43.7\% (2) \\
SBP+SARD & 30.5\% (1) & 37.8\% (1) & 37.9\% (1) \\
Pairwise difference & \textbf{4.6\%***} & \textbf{7.8\%***} &  \\ \hline
\end{tabular}
\end{table}

\end{document}
  • Don't use the flushleft environment for a justified text! – Bernard May 29 '19 at 12:33
  • Please provide a full example that actually compiles – Steven B. Segletes May 29 '19 at 12:36
  • I see you edited your question. However, there is still no \documentclass, and \usepackage appears after \begin{document} (not allowed), and \smaller is still not defined. – Steven B. Segletes May 29 '19 at 12:41
  • @StevenB.Segletes - I edited the code. My bad for wrongfully placement. It works now as an MWE for me. – Philip May 29 '19 at 12:46
  • There is still no \documentclass provided, and \Plus is not defined. – Steven B. Segletes May 29 '19 at 12:52
0

Just put your text inside a \parbox to neutralise the centering command. I took the opportunity to add some improvements to the table layout:

\documentclass{article}
\usepackage[table,xcdraw]{xcolor}
\usepackage[showframe]{geometry}
\usepackage{relsize}


\begin{document}

\begin{table}[!h]
\centering
\setlength{\extrarowheight}{2pt}
\smaller
\caption{Valuation errors by the combinatorial selection schemes for the S\&P sub-indices}
\label{Results.Robustness.FirmSize}\medskip
\parbox{\textwidth}{This table reports the median and arithmetic mean of the absolute percentage errors generated by the two combinatorial peer selection schemes SBP+SARD and GICS+SARD, for constituents of the S\&P 500, 400 and 600 indices. The median and arithmetic mean of the pairwise valuation error differences are statistically tested through the Wilcoxon signed rank test and Student's t-test, respectively. Each combinatorial selection scheme has used the EV/EBITDA, EV/EBIT and P/E multiple to value a target firm. A positive pairwise median difference indicates that the SBP+SARD generates a higher valuation accuracy, relative to GICS+SARD, and vice versa. Statistical significance is denoted by *, **, *** indicating 10\%, 5\% and 1\% respectively.}
 \vspace{0.2cm}

\begin{tabular}{|lccc|}
\hline
\rowcolor[HTML]{003085}
{\color[HTML]{FFFFFF} \textbf{S\&P 500}} & {\color[HTML]{FFFFFF} \textbf{Median}} & {\color[HTML]{FFFFFF} \textbf{Mean}} & {\color[HTML]{FFFFFF} \textbf{IQ range}} \\
\textbf{EV/EBITDA} & & & \\
GICS+SARD & 25.1\% (2) & 31.5\% (2) & 34.2\% (2) \\
SBP+SARD & 20.7\% (1) & 27.9\% (1) & 27.4\% (1) \\
Pairwise difference & \textbf{4.2\%***} & \textbf{3.5\%***} & \\
\textbf{EV/EBIT} & & & \\
GICS+SARD & 23.7\% (2) & 29.6\% (2) & 31.4\% (2) \\
SBP+SARD & 20.5\% (1) & 27.5\% (1) & 28.2\% (1) \\
Pairwise difference & \textbf{2.5\%***} & \textbf{2.0\%***} & \\
\textbf{P/E} & & & \\
GICS+SARD & 30.5\% (2) & 42.2\% (2) & 45.6\% (2) \\
SBP+SARD & 27.7\% (1) & 39.2\% (1) & 41.2\% (1) \\
Pairwise difference & \textbf{3.3\%***} & \textbf{3.0\%***} & \\[1ex]
\rowcolor[HTML]{003085}
{\color[HTML]{FFFFFF} \textbf{S\&P 400}} & {\color[HTML]{FFFFFF} \textbf{Median}} & {\color[HTML]{FFFFFF} \textbf{Mean}} & {\color[HTML]{FFFFFF} \textbf{IQ range}} \\
\textbf{EV/EBITDA} & & & \\
GICS+SARD & 27.7\% (2) & 42.4\% (2) & 36.6\% (2) \\
SBP+SARD & 24.8\% (1) & 33.1\% (1) & 34.3\% (1) \\
Pairwise difference & \textbf{2.9\%***} & \textbf{10.3\%***} & \\
\textbf{EV/EBIT} & & & \\
GICS+SARD & 30.8\% (2) & 44.5\% (2) & 39.6\% (2) \\
SBP+SARD & 25.3\% (1) & 34.2\% (1) & 33.2\% (1) \\
Pairwise difference & \textbf{5.9\%***} & \textbf{2.0\%***} & \\
\textbf{P/E} & \multicolumn{1}{l}{} & \multicolumn{1}{l}{} & \multicolumn{1}{l|}{} \\
GICS+SARD & \multicolumn{1}{l}{40.0\% (2)} & \multicolumn{1}{l}{52.6\% (2)} & \multicolumn{1}{l|}{55.7\% (2)} \\
SBP+SARD & \multicolumn{1}{l}{34.1\% (1)} & \multicolumn{1}{l}{48.9\% (1)} & \multicolumn{1}{l|}{45.9\% (1)} \\
Pairwise difference & \textbf{6.2\%***} & \textbf{3.6\%***} & \\[1ex] \hline
\rowcolor[HTML]{003085}
{\color[HTML]{FFFFFF} \textbf{S\&P 600}} & {\color[HTML]{FFFFFF} \textbf{Median}} & {\color[HTML]{FFFFFF} \textbf{Mean}} & {\color[HTML]{FFFFFF} \textbf{IQ range}} \\ \hline
\textbf{EV/EBITDA} & & & \multicolumn{1}{l|}{} \\
GICS+SARD & 28.2\% (2) & 40.0\% (2) & 36.1\% (2) \\
SBP+SARD & 24.6\% (1) & 31.3\% (1) & 32.1\% (1) \\
Pairwise difference & \textbf{3.9\%***} & \textbf{8.7\%***} & \\
\textbf{EV/EBIT} & & & \\
GICS+SARD & 27.1\% (2) & 36.3\% (2) & 36.3\% (2) \\
SBP+SARD & 25.3\% (1) & 31.7\% (1) & 33.9\% (1) \\
Pairwise difference & \textbf{2.7\%***} & \textbf{4.6\%***} & \\
\textbf{P/E} & & & \\
GICS+SARD & 33.4\% (2) & 45.6\% (2) & 43.7\% (2) \\
SBP+SARD & 30.5\% (1) & 37.8\% (1) & 37.9\% (1) \\
Pairwise difference & \textbf{4.6\%***} & \textbf{7.8\%***} & \\ \hline
\end{tabular}
\end{table}

\end{document} 

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.