1

Here's my code:

\documentclass[fleqn,10pt]{SelfArx}
\setlength{\columnsep}{0.55cm}
\setlength{\fboxrule}{0.75pt}
\definecolor{color1}{RGB}{0,0,90}
\definecolor{color2}{RGB}{0,20,20}

\begin{document}

\begin{table}[h]
\caption*{Results}
\begin{tabular}{ p{5cm} p{3cm} p{2cm} p{3cm} }  
\hline \\ [-0.3cm]
\textsc{Model} \\

parameters & Value $\pm$ $\theta$ &  p-values & range   \\ [0.5ex]
\hline 
\textbf{A} \\
\hspace{1cm} x & -0.1 $\pm$ 0.216  & 0.0000 & (-1.000, -0.560)  \\ 
\hspace{1cm} y & -2.1 $\pm$ 0.279  & 0.0000 & (-2.600, -1.500) \\ 
\hspace{1cm} z ($s^{-1}$)  & \hspace{0.15cm}0.1 $\pm$ 0.200 & 0.0001 & (0.400, 1.200) \\ 
\hspace{1cm} t1  & 1002  \\ 
\hline
\textbf{B} \\
\textbf{para1} \\
\hspace{1cm} b1 &  0.229 $\pm$ 1.104 & 0.800 & (-2.300, 1.900)  \\ 
\hspace{1cm} b2 & -0.753 $\pm$ 1.850  & 0.777  & (-4.100, 2.900)  \\ 
\hspace{1cm} b3 & -0.876 $\pm$ 1.863  & 0.5999  & (-4.000, 3.100) \\
\hspace{1cm} b4   & -0.6324 $\pm$ 1.176 & 0.5227  & (-3.200, 1.300) \\ 
\hspace{1cm} b5   & -0.123 $\pm$ 1.516 & 0.7882 & (-3.200, 2.600) \\ 
\hspace{1cm} b6  & -5.500 $\pm$ 1.522 & 0.0029 & (-7.800, -1.900) \\ 
\hspace{1cm} b7   & -0.600$\pm$ 1.120 & 0.6198 & (-2.700, 1.600)  \\ 

\textbf{para2} \\
\hspace{1cm} $a1 $  &   -1.00  $\pm$ 0.462 & 0.0356 &(-1.900, -0.100) \\ 
\hspace{1cm} a2   & -0.210 $\pm$ 0.092 & 0.0071 & (-0.400, -0.100) \\ 
\hspace{1cm} a3   &  \hspace{0.05cm} 1.10 $\pm$ 0.500 & 0.0099 & (0.600, 2.600) \\ 
\hspace{1cm}  a4    & -0.10 $\pm$ 0.059 & 0.0124 & (-0.200, -0.010) \\ 
\hspace{1cm} t2  &  20000      \\

\hline
\end{tabular}
\caption{Table 1 } 
\label{tab_1}
\end{table}

\end{document}

Apologies for the rather lengthy code-it is needed to illustrate the current problem. The above code was taken from a latex template. My problem is that the table inserted on the second page is too large for the page. This is due to the fact that the page is divided into two columns. I was just wondering if there was a way for me to make the table extend across the two columns without overlapping with the text. I'm guessing this documentclass automatically divides pages into two because I cant find any code that's responsible for this in the above. I know I could use \begin{table}[p] to move the table into a separate page but ideally I would like the table to be within the document rather than beyond bibliography.

marked as duplicate by Martin Schröder, Andrew Swann, Svend Tveskæg, Jesse, user13907 Jan 15 '15 at 12:42

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Hi John and welcome to TeX.SX. In its current form, your question might not receive many answers. Please take a look at the How to Ask-page and try to improve your question according to the guidance found there. This may require you to show some effort on your part in terms of attempting a solution. If you have questions about what to do or if you don't quite understand what this means, please ask for clarification using the add comment function. – Martin Schröder Jan 15 '15 at 12:16
  • Thanks for letting me know. I'll have a read and implement in future posts. – John_dydx Jan 15 '15 at 15:44
6

You can use

\begin{table*}
    ...
\end{table*}

to let a table span two columns.

And to be honest, not much of your code is "needed to illustrate the current problem". For example, it has nothing to do with the SelfArx class you're using (and I first had to look for), and most of the other code you posted.

Here's a much more minimal version of your code

\documentclass[twocolumn]{article}

\usepackage{lipsum}
\usepackage{booktabs}
\usepackage{siunitx}

\title{Title}
\author{John Smith}

\begin{document}

\maketitle

\section{Section}
\lipsum[1-4]

\begin{table*}
    \centering
    \caption{Table caption}
    \begin{tabular}{csss}  
        \toprule
        \textsc{Model} \\
        Parameters & Value $\pm$ $\theta$ &  p-values & range\\
        \midrule
        \textbf{A} \\
        x & -0.1 $\pm$ 0.216  & 0.0000 & (-1.000, -0.560)  \\ 
        ...\\
        \midrule
        \textbf{B} \\
        \textbf{para1} \\
        b1 &  0.229 $\pm$ 1.104 & 0.800 & (-2.300, 1.900)  \\ 
        \ldots\\
        \bottomrule
        \end{tabular}
\end{table*}

\lipsum[5-9]

\end{document}
  • thanks. How do I ensure the table stays within the document as opposed to at the end of the document? – John_dydx Jan 14 '15 at 12:38
  • 2
    Write your text until it's done. Then fiddle with the table placement. Your tables are so-called floats, which are placed based on the contents of your document by LaTeX. See this question regarding float placement: tex.stackexchange.com/questions/8625/… – Habi Jan 14 '15 at 12:56

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