So basically my tables work fine under the tabular format, but in some cases I need to use tabularx because they are too large to fit within the normal textwidth.
However, the rows become infinitely long, due to an erroneous extra column it seems?
EDIT: Changed the table to my actual table. Image1 shows the same code using tabular and without the \noindent\makebox. As you can see, the table is too wide and floats slightly off to the right, hence I try using tabularx to make it wider, such that it can be centred on the page. However it gives a weird unending rows.
In image1, the table is wider than the text width, though at least it correctly ends. Hence I try using tabularx in the code below, which results in image2:
Code:
\begin{table}[!h]
\label{table-A_3_posthoc}
\centering
\small
\caption[One-way ANOVA tests for scenarios 14, 16, 18 and 19-22]{One-way ANOVA tests showing the variation between sample means in three different internetwork topologies. Comparisons without a significant level (SL) were deemed statistically insignificantly different i.e. $p > 0.05$.\\}
\noindent\makebox[\textwidth]{%
\begin{tabularx}{1.5\textwidth}{l|r|r|r|r|r|r|r|r}
\toprule
One-way ANOVA & SL($\langle k \rangle$) & SL($\overline{C_E}$) & SL($D$) & SL($\ell$) & SL($G_E$) & SL($C_G$) & SL($\Phi$) & SL($\Gamma$)\\
\midrule
14 and 19 & 0.010 & & 0.010 & 0.001 & 0.001 & 0.001 & 0.001 & 0.001\\
16 and 20 & 0.001 & & 0.010 & 0.001 & 0.001 & 0.050 & & \\
18 and 21 & 0.001 & 0.050 & 0.050 & 0.001 & 0.001 & 0.001 & 0.010 & 0.010\\
\bottomrule
\end{tabularx}}
\end{table}
Preamble:
\usepackage{parskip}
\usepackage[margin=1.4in]{geometry}
\usepackage{amsmath,amssymb} % For using * for no eq. numbers
\usepackage{amsthm}
\usepackage[]{graphicx} % For inserting figures etc
\usepackage{booktabs} % For \toprule, \midrule and \bottomrule
\usepackage{url}
\usepackage{titlesec}
\usepackage{tabularx}
\usepackage{verbatim}
\usepackage[toc,page]{appendix}
\usepackage[nottoc,notlot,notlof]{tocbibind}
\usepackage{etoolbox}
\usepackage{adjustbox}
\usepackage{framed}
\usepackage{cite}
\usepackage{subfigure}
\usepackage{algpseudocode}
\usepackage{algorithm}
\usepackage{algorithmicx}
1.5\textwidth
). You ask for a table one and a half times as wide as the text. Is it really what you want?\textwidth
that be centred?