Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

So i want to make the following table fit in my text width. The table is much longer than the text. Any propositions? Thanks in advance. Here is the table code (dont pay attention to the comments' lines with %)

\begin{table}[htbbp] \caption{Methods performance for
random model coefficients using 1000 simulations in a two level
factorial design}\label{Table 1}
{\tiny \centering
\begin{tabular}{@{}|@{}c|c|cc|cc|cc|cc|cc|cc@{}|@{}}
%\multicolumn{14}{c}{{\bf Table 1.} Methods performance for
%random model coefficients using 1000 }\\
%\multicolumn{14}{c}{simulations in a two level factorial design}\\
%\multicolumn{11}{c}{$ $} \\
\hline  \multicolumn{1}{|c|}{$ $}&
\multicolumn{1}{|c|}{$q$}&\multicolumn{2}{|c|}{SCAD(gcv)}&\multicolumn{2}{|c|}{SCAD$(\eta_\nu(\lambda))$}&\multicolumn{2}{|c|}{LASSO(gcv)}&\multicolumn{2}{|c|}
{LASSO$(\eta_\nu(\lambda))$}&\multicolumn{2}{|c|}{Hard(gcv)}&\multicolumn{2}{|c|}{Hard$(\eta_\nu(\lambda))$} \\
\hline {\bf Design}&{\bf Factors}& \mbox{Type I} & Type II &
\mbox{Type I} & Type II & \mbox{Type I} & Type II
& \mbox{Type I} & Type II & \mbox{Type I} & Type II & \mbox{Type I} & Type II \\
\hline $ 2^{5}$FD
&1&0.12&0.00&0.00&0.00&0.11&0.00&0.03&0.00&0.11&0.00&0.01&0.00\\
&2&0.11&0.00&0.01&0.00&0.10&0.00&0.02&0.00&0.10&0.00&0.01&0.00\\
&3&0.10&0.00&0.00&0.00&0.11&0.00&0.02&0.00&0.11&0.00&0.01&0.00\\
&4&0.11&0.00&0.00&0.00&0.10&0.00&0.01&0.00&0.10&0.00&0.01&0.00\\
\hline
\multicolumn{11}{c}{$ $} \\
\multicolumn{11}{c}{$ $} \\
\multicolumn{11}{c}{$ $} \\
\end{tabular}
\end{table}
share|improve this question
    
Use the button with two braces {} to insert codes. –  Sigur Jan 8 at 20:14
    
Welcome to TeX.SX! Please make your code compilable (if possible), or at least complete it with \documentclass{...}, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. –  Jubobs Jan 8 at 20:42

1 Answer 1

I've made the code compilable, and modified a few commands: e.g. I suppressed the \mbox{} commands and the last three \multicolumn{11}{c}{$ $ }, as I did not understand what they were for, and replaced \bf (plain TeX) with \bfseries (LaTeX). Here is a code which does what you expect, as far as I understand it.

\documentclass[12pt,a4paper]{article}
    \usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}%
\usepackage[textwidth=16cm, nohead, nomarginpar, showframe]{geometry}

\usepackage{array}
\usepackage{caption}

\begin{document}
\begin{table}[htb]\captionsetup{justification = centerlast, font =scriptsize}
\caption{Methods performance for random model coefficients using \\ 1000 simulations in a   
          two level factorial design}\label{Table 1}
\scriptsize \centering \renewcommand{\tabcolsep}{2pt}\renewcommand{\arraystretch}{1.5}%
\begin{tabular}{|c|c|cc|cc|cc|cc|cc|cc|} %
\hline%
 & $q$ & \multicolumn{2}{c|}{SCAD(gcv)} & \multicolumn{2}{c|}{SCAD$(\eta_\nu(\lambda))$}  
 & \multicolumn{2}{c|}{LASSO(gcv)} & \multicolumn{2}{c|} {LASSO$(\eta_\nu(\lambda))$}  
 & \multicolumn{2}{c|}{Hard(gcv)} & \multicolumn{2}{c|}{Hard$(\eta_\nu(\lambda))$} \\
\hline%
{\bfseries Design} & {\bfseries Factors} &Type I & Type II & Type I & Type II &Type I & Type II & Type I & Type II & Type I & Type II & Type I & Type II \\
\hline%
$ 2^{5}$FD & 1 & 0.12 & 0.00 & 0.00 & 0.00 & 0.11 & 0.00 & 0.03 & 0.00 & 0.11 & 0.00 & 0.01 & 0.00 \\
& 2 & 0.11 & 0.00 & 0.01 & 0.00 & 0.10 & 0.00 & 0.02 & 0.00 & 0.10 & 0.00 & 0.01 & 0.00 \\
& 3 & 0.10 & 0.00 & 0.00 & 0.00 & 0.11 & 0.00 & 0.02 & 0.00 & 0.11 & 0.00 & 0.01 & 0.00 \\
& 4 & 0.11 & 0.00 & 0.00 & 0.00 & 0.10 & 0.00 & 0.01 & 0.00 & 0.10 & 0.00 & 0.01 & 0.00 \\
\hline %
\end{tabular}
\end{table}

\end{document}

and the result:

share|improve this answer
    
When I copied the code in the original question, There indeed were ‘\ ’ instead of ‘\\’. It seems to have been edited. So I'll suppress the comments about this point. –  Bernard Jan 9 at 0:27

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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