[Tex/LaTex] making to fit a table in LNCS page style

lncstables

This is my table skeleton

output_example

which I have problem to make it to fit in a LNCS style page, especially the headers (2 first rows) as they contain text and the other cells inside the table contain only one symbol per cell, e.g. "+".

Any help how I can solve it? I do not need for the lines, sure. I am using the booktabs package.

Edit 1:

Some of my code is:

\documentclass{llncs}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{makeidx}
\usepackage{graphicx}
\usepackage{lmodern}

\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}


\usepackage{booktabs}
\newcommand{\ra}[1]{\renewcommand{\arraystretch}{#1}}
\usepackage{xcolor}
\usepackage{tabularx}

\usepackage{float}
\restylefloat{table}

\usepackage{array}
\newcolumntype{P}[1]{>{\centering\arraybackslash}p{#1}}

\usepackage{float}
\floatstyle{plaintop}
\restylefloat{table}

\usepackage{multirow}
% end: for table

%begin: for landscape table
\usepackage{pdflscape}
\usepackage{lscape}
%end: for landscape table

\usepackage{xspace}

\newcommand{\bs}{$\blacksquare$ \xspace}
\newcommand{\sr}{$\square$ \xspace}
\newcommand{\lt}{$\blacktriangleleft$ \xspace}



\begin{document}

\begin{landscape}
\begin{table}[]
%\centering
\small
\caption{Something which is moving my table too down}
\label{my-label}
\hskip-3.0cm \vskip-2.0cm \begin{tabular}{@{}p{4cm}p{0.6cm}p{0.6cm}p{0.6cm}p{0.6cm}p{0.6cm}p{0.6cm}p{0.6cm}p{0.6cm}p{0.6cm}p{0.6cm}p{0.6cm}p{0.6cm}p{0.6cm}p{0.6cm}p{0.6cm}p{0.6cm}p{0.6cm}p{0.6cm}p{0.6cm}p{0.6cm}p{0.6cm}p{0.6cm}p{0.6cm}p{0.6cm}@{}}
\toprule
{\color[HTML]{009901}{} } & \multicolumn{3}{l}{{\color[HTML]{009901}{{}} }} & \multicolumn{2}{l}{{\color[HTML]{009901}{\rotatebox[origin=r]{90}{}} }} & {\color[HTML]{009901}{\rotatebox[origin=r]{90}{}} } & {\color[HTML]{009901}{\rotatebox[origin=r]{90}{}} } & \multicolumn{2}{l}{{\color[HTML]{009901}{\rotatebox[origin=r]{90}{}} }} & \multicolumn{3}{l}{{\color[HTML]{009901}{\rotatebox[origin=r]{90}{}} }} & \multicolumn{2}{l}{{\color[HTML]{009901}{\rotatebox[origin=r]{90}{}} }} & \multicolumn{2}{l}{{\color[HTML]{009901}{\rotatebox[origin=r]{90}{}} }} & {\color[HTML]{009901}{\rotatebox[origin=r]{90}{}} } & {\color[HTML]{009901}{\rotatebox[origin=r]{90}{}} } & {\color[HTML]{009901}{\rotatebox[origin=r]{90}{}} } & {\color[HTML]{009901}{\rotatebox[origin=r]{90}{}} } & {\color[HTML]{009901}{\rotatebox[origin=r]{90}{}} } & {\color[HTML]{009901}{\rotatebox[origin=r]{90}{}} } & {\color[HTML]{009901}{\rotatebox[origin=r]{90}{}} } & {\color[HTML]{009901}{\rotatebox[origin=r]{90}{}} } \\ \midrule

{\color[HTML]{009901} \textit{}} & {\color[HTML]{009901} {\rotatebox[origin=r]{90}{\textit{}}}} & {\color[HTML]{009901} {\rotatebox[origin=r]{90}{\textit{}}}} & {\color[HTML]{009901} {\rotatebox[origin=r]{90}{\textit{}}}} & {\color[HTML]{009901} \textit{}} & {\color[HTML]{009901} \textit{}} & {\color[HTML]{009901} \textit{}} & {\color[HTML]{009901} \textit{}} & {\color[HTML]{009901} \textit{}} & {\color[HTML]{009901} \textit{}} & {\color[HTML]{009901} \textit{}} & {\color[HTML]{009901} \textit{}} & {\color[HTML]{009901} \textit{}} & {\color[HTML]{009901} \textit{}} & {\color[HTML]{009901} \textit{}} & {\color[HTML]{009901} \textit{}} & {\color[HTML]{009901} \textit{}} & {\color[HTML]{009901} \textit{}} & {\color[HTML]{009901} \textit{}} & {\color[HTML]{009901} \textit{}} & {\color[HTML]{009901} \textit{}} & {\color[HTML]{009901} \textit{}} & {\color[HTML]{009901} \textit{}} & {\color[HTML]{009901} \textit{}} & {\color[HTML]{009901} \textit{}} \\

\multicolumn{3}{l}{\color[HTML]{34696D}{} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } \\

Something1 & \lt & \bs & \lt & \bs & \lt & \bs & \bs & \lt & \bs & \lt & \bs & \sr & \bs & \sr & \sr & \bs & ao &  & A & \sr & \lt & \bs & \bs & \lt \\
Something2 & \lt & \bs & \lt & \bs & \lt & \bs & \bs & \lt & \bs & \lt & \bs & \sr & \bs & \sr & \sr & \bs & ao &  & A & \sr & \lt & \bs & \bs & \lt \\
\multicolumn{3}{l}{\color[HTML]{34696D}{} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } \\
Something3 & \lt & \bs & \lt & \bs & \lt & \bs & \bs & \lt & \bs & \lt & \bs & \sr & \bs & \sr & \sr & \bs & ao &  & A & \sr & \lt & \bs & \bs & \lt \\
 Something4 & \bs & \sr & \lt & \bs & \sr & \bs  & \sr & \bs & \sr & \bs & \bs & \bs & \sr & \bs & \bs & \sr & ind &  & I & \sr & \bs & \lt & \bs & \lt \\
 Something5 & \lt & \bs &  &  & \bs & \bs  & \lt & \sr & \bs & \sr & \bs & \sr & \bs & \sr & \bs & \sr & oo &  & A & \bs &  & \lt & \lt & \lt \\
Something6 & \bs & \lt & \lt & \bs & \bs & \bs &  & \bs & \bs & \bs & \bs & \sr & \bs & \sr & \bs & \sr & oo &  & E & \lt & \sr & \bs & \lt & \lt \\
 something7 & \bs & \bs & \lt & \bs & \bs & \bs & \bs & \sr & \bs & \bs & \bs & \sr & \bs & \sr & \bs & \sr & oo &  & E & \lt &  & \sr & \sr & \lt \\
 Something8 &  &  &  & \lt & \bs &  & \lt & \sr & \bs & \bs & \bs & \lt & \bs & \sr & \bs & \sr & oo &  & E &  & \sr & \bs & \bs & \lt \\
\multicolumn{3}{l}{\color[HTML]{34696D}{\textbf{Anotherthing}} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } \\
Something9 & \lt & \lt & \lt &  & \bs & \bs & \bs & \sr & \bs & \bs &  &  & \bs & \sr & \bs & \sr & oo &  & A & \bs & \sr &  &  &  \\
Something10 & \sr & \sr & \bs & \bs & \sr & \bs & \bs & \lt & \bs &  & \bs &  & \bs & \sr & \bs & \sr & pr &  & A & \bs & \sr & \lt & \lt & \lt \\
Something11 & \sr & \sr & \bs &  & \bs & \bs & \bs & \sr & \bs & \bs & \bs &  & \bs & \sr & \bs & \sr & oo &  & A & \lt & \sr & \bs & \bs & \bs \\
Something12 & \lt & \bs & \bs & \bs &  & \bs & \bs & \bs & \bs & \bs &  &  & \bs & \sr & \bs & \sr & ge &  & E & \bs & \sr & \lt & \bs & \lt \\
\multicolumn{3}{l}{\color[HTML]{34696D}{\textbf{Anotherthing2}} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } \\
 Something13 &\bs & \bs &  & \lt & \bs & \bs & \bs & \lt & \bs & \bs & \bs & \sr & \bs & \sr & \bs & \sr & oo &  & I/E & \bs & \sr & \bs & \bs & \lt \\
 Something14 & \bs & \sr & \bs & \lt & \bs & \bs & \bs & \sr & \bs & \bs & \bs & \sr & \bs & \sr & \bs & \sr & oo &  & E & \lt & \sr & \bs & \bs & \lt \\
 Something15 & \bs & \lt & \bs & \lt & \bs & \bs & \bs & \sr & \bs & \bs & \bs & \sr & \bs & \sr & \bs & \sr & oo &  & E & \bs & \sr & \bs & \bs & \lt \\
 Something16 & \bs & \bs & \sr & \lt & \bs & \bs & \bs & \sr & \bs & \bs & \bs & \sr & \bs & \sr & \bs & \sr & oo &  & E & \bs & \sr & \bs & \bs & \lt \\
 Something17 & \lt & \sr & \bs & \lt & \bs & \bs & \bs & \sr & \bs & \bs & \bs & \sr & \bs & \sr & \bs & \sr & oo &  & E & \bs & \sr & \bs & \bs & \lt \\
\multicolumn{3}{l}{\color[HTML]{34696D}{\textbf{Anotherthing3}} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } & {\color[HTML]{34696D} } \\
 Something18 & \lt & \bs & \lt & \bs & \lt & \bs & \bs & \lt & \bs & \lt & \bs & \sr & \bs & \sr & \sr & \bs & ao &  & A & \sr & \lt & \bs & \bs & \lt \\
Something19 & \lt & \bs & \lt & \bs & \lt & \bs & \bs & \lt & \bs & \lt & \bs & \sr & \bs & \sr & \sr & \bs & ao &  & A & \sr & \lt & \bs & \bs & \lt \\
 Something20 & \lt & \bs & \lt & \bs & \lt & \bs & \bs & \lt & \bs & \lt & \bs & \sr & \bs & \sr & \sr & \bs & ao &  & A & \sr & \lt & \bs & \bs & \lt \\
 Something21 & \lt & \bs & \lt & \bs & \lt & \bs & \bs & \lt & \bs & \lt & \bs & \sr & \bs & \sr & \sr & \bs & ao &  & A & \sr & \lt & \bs & \bs & \lt \\
 Something22 & \lt & \bs & \lt & \bs & \lt & \bs & \bs & \lt & \bs & \lt & \bs & \sr & \bs & \sr & \sr & \bs & ao &  & A & \sr & \lt & \bs & \bs & \lt \\\bottomrule
\end{tabular}

\end{table}
\end{landscape}
\end{document}

Edit 2:

Changed header:
enter image description here

Edit 3:

This is what is looking to me using the LNCS class:
enter image description here

Except that the page before become landscape and is blank the table itself is narrowed in the "text size" of a vertical alignment! Actually, I changed these three things from your solution:

  1. I am using the LNCS class which is required
  2. I removed the \usepackage[margin=2cm]{geometry} because it's "destroying" the standard margins of the page something that I am not allowed to touch 🙁
  3. I removed the mathtools from \usepackage{mathtools,amssymb} because for some reasons I cannot get that!

Best Answer

Edit: I think, that the llncs document class is not the first concern. Table is huge, so it need to be deliberately designed (shrink) ...

For table below I did the following:

  • by defining colors by newcolor in document preamble the table code is significantly reduced
  • by defining new commands:\crb, \cit and mcit also reduce the table code
  • by changing column type p{0.6cm} to c the width of table becomm smaller
  • by eliminating of xspace the column become narrower and content is now in columns center.
  • color for rows, which contains text Another thing ... is determined by \rowcolor{...} and text put in \multicolumn{25}{l}{ ... text ...}
  • the float table is removed, for caption is used captionof{table}{...}. It works fine, so the manual positioning of table is not needed anymore
  • the code partial consider your new column heads design. Since \rotatebox doesn't work well in multirow cells, the column heads are only in one row.
  • for multiline cels in the first row is used \stackon macro from package stackengine

The complete code with only necessary packages is:

\documentclass{article}
    \usepackage[utf8]{inputenc}
    \usepackage{array,amsmath,amssymb}% amsmath instal amsfonts
    \usepackage{graphicx}
    \usepackage{lmodern}
    \usepackage[margin=2cm]{geometry}% instead of [left=2cm,right=2cm,top=2cm,bottom=2cm]
    \usepackage{caption}
    \usepackage[table]{xcolor}
% my colors    
\definecolor[named]{mygreen}{HTML}{009901}
\definecolor[named]{myteal}{HTML}{34696D}
    \usepackage{booktabs}
    \usepackage{stackengine}
%begin: for landscape table
    \usepackage{pdflscape}
    \usepackage{lscape}
%end: for landscape table
\newcommand{\bs}{$\blacksquare$}
\newcommand{\sr}{$\square$}
\newcommand{\lt}{$\blacktriangleleft$}
%new commands    
\newcommand{\crb}[1]{\rotatebox[origin=l]{90}{\itshape\textcolor{mygreen}{#1}}}
\newcommand{\cit}[1]{\textit{\textcolor{mygreen}{#1}}}
\newcommand{\mcit}[2]{\multicolumn{#1}{c}{\textit{\textcolor{mygreen}{#2}}}}

    \begin{document}
\begin{landscape}
        \centering
        \small
\captionof{table}{Something which is moving my table too down}% Add 'table' caption
\label{my-label}
    \renewcommand{\arraystretch}{1.1}
\begin{tabular}{l *{24}{c}}
    \toprule   
 & \mcit{3}{\stackon{align}{horizontal}}
   & \mcit{2}{\stackon{align}{horizontal}}
     & 
       & 
         & \mcit{2}{\stackon{align}{horizontal}}
 & \mcit{3}{\stackon{align}{horizontal}}
   & \mcit{2}{\stackon{align}{horizontal}}
     & \mcit{2}{\stackon{align}{horizontal}}
       & & & & & & &  
       \\
 \cmidrule(lr){2-4}\cmidrule(lr){5-6}\cmidrule(lr){9-10}%
 \cmidrule(lr){11-13}\cmidrule(lr){14-15}\cmidrule(lr){16-17}
 & \crb{vertical align}
   & \crb{align}
     & \crb{vertical}
       & \crb{vertical align}
         & \crb{vertical align}
           & \crb{vertical align}
 & \crb{vertical align}
   & \crb{vertical align}
     & \crb{vertical align}
       & \crb{vertical align}
         & \crb{vertical align}
           & \crb{vertical align}
 & \crb{vertical align}
   & \crb{vertical align}
     & \crb{vertical align}
       & \crb{vertical align}
         & \crb{vertical align}
           & \crb{vertical align}
 & \crb{vertical align}
   & \crb{vertical align}
     & \crb{vertical align}
       & \crb{vertical align}
         & \crb{vertical align}                                                
         \\
\rowcolor{myteal}
   \multicolumn{25}{l}{\color{white}\textbf{Another thing 3}} 
        \\
Something1 & \lt & \bs & \lt & \bs & \lt & \bs & \bs & \lt & \bs & \lt & \bs & \sr & \bs & \sr & \sr & \bs & ao &  & A & \sr & \lt & \bs & \bs & \lt \\
Something2 & \lt & \bs & \lt & \bs & \lt & \bs & \bs & \lt & \bs & \lt & \bs & \sr & \bs & \sr & \sr & \bs & ao &  & A & \sr & \lt & \bs & \bs & \lt \\
\rowcolor{myteal}
   \multicolumn{25}{l}{}                \\
Something3 & \lt & \bs & \lt & \bs & \lt & \bs & \bs & \lt & \bs & \lt & \bs & \sr & \bs & \sr & \sr & \bs & ao &  & A & \sr & \lt & \bs & \bs & \lt \\
 Something4 & \bs & \sr & \lt & \bs & \sr & \bs  & \sr & \bs & \sr & \bs & \bs & \bs & \sr & \bs & \bs & \sr & ind &  & I & \sr & \bs & \lt & \bs & \lt \\
 Something5 & \lt & \bs &  &  & \bs & \bs  & \lt & \sr & \bs & \sr & \bs & \sr & \bs & \sr & \bs & \sr & oo &  & A & \bs &  & \lt & \lt & \lt \\
Something6 & \bs & \lt & \lt & \bs & \bs & \bs &  & \bs & \bs & \bs & \bs & \sr & \bs & \sr & \bs & \sr & oo &  & E & \lt & \sr & \bs & \lt & \lt \\
 something7 & \bs & \bs & \lt & \bs & \bs & \bs & \bs & \sr & \bs & \bs & \bs & \sr & \bs & \sr & \bs & \sr & oo &  & E & \lt &  & \sr & \sr & \lt \\
 Something8 &  &  &  & \lt & \bs &  & \lt & \sr & \bs & \bs & \bs & \lt & \bs & \sr & \bs & \sr & oo &  & E &  & \sr & \bs & \bs & \lt \\
\rowcolor{mygreen} 
   \multicolumn{25}{l}{\textbf{Another thing 1}}     \\
Something9 & \lt & \lt & \lt &  & \bs & \bs & \bs & \sr & \bs & \bs &  &  & \bs & \sr & \bs & \sr & oo &  & A & \bs & \sr &  &  & \\
Something10 & \sr & \sr & \bs & \bs & \sr & \bs & \bs & \lt & \bs &  & \bs &  & \bs & \sr & \bs & \sr & pr &  & A & \bs & \sr & \lt & \lt & \lt \\
Something11 & \sr & \sr & \bs &  & \bs & \bs & \bs & \sr & \bs & \bs & \bs &  & \bs & \sr & \bs & \sr & oo &  & A & \lt & \sr & \bs & \bs & \bs \\
Something12 & \lt & \bs & \bs & \bs &  & \bs & \bs & \bs & \bs & \bs &  &  & \bs & \sr & \bs & \sr & ge &  & E & \bs & \sr & \lt & \bs & \lt \\
\rowcolor{mygreen}
   \multicolumn{25}{l}{\textbf{Another thing 2}}     \\
 Something13 &\bs & \bs &  & \lt & \bs & \bs & \bs & \lt & \bs & \bs & \bs & \sr & \bs & \sr & \bs & \sr & oo &  & I/E & \bs & \sr & \bs & \bs & \lt \\
 Something14 & \bs & \sr & \bs & \lt & \bs & \bs & \bs & \sr & \bs & \bs & \bs & \sr & \bs & \sr & \bs & \sr & oo &  & E & \lt & \sr & \bs & \bs & \lt \\
 Something15 & \bs & \lt & \bs & \lt & \bs & \bs & \bs & \sr & \bs & \bs & \bs & \sr & \bs & \sr & \bs & \sr & oo &  & E & \bs & \sr & \bs & \bs & \lt \\
 Something16 & \bs & \bs & \sr & \lt & \bs & \bs & \bs & \sr & \bs & \bs & \bs & \sr & \bs & \sr & \bs & \sr & oo &  & E & \bs & \sr & \bs & \bs & \lt \\
 Something17 & \lt & \sr & \bs & \lt & \bs & \bs & \bs & \sr & \bs & \bs & \bs & \sr & \bs & \sr & \bs & \sr & oo &  & E & \bs & \sr & \bs & \bs & \lt \\
\rowcolor{mygreen}
   \multicolumn{25}{l}{\textbf{Another thing 3}}     \\
 Something18 & \lt & \bs & \lt & \bs & \lt & \bs & \bs & \lt & \bs & \lt & \bs & \sr & \bs & \sr & \sr & \bs & ao &  & A & \sr & \lt & \bs & \bs & \lt \\
Something19 & \lt & \bs & \lt & \bs & \lt & \bs & \bs & \lt & \bs & \lt & \bs & \sr & \bs & \sr & \sr & \bs & ao &  & A & \sr & \lt & \bs & \bs & \lt \\
 Something20 & \lt & \bs & \lt & \bs & \lt & \bs & \bs & \lt & \bs & \lt & \bs & \sr & \bs & \sr & \sr & \bs & ao &  & A & \sr & \lt & \bs & \bs & \lt \\
 Something21 & \lt & \bs & \lt & \bs & \lt & \bs & \bs & \lt & \bs & \lt & \bs & \sr & \bs & \sr & \sr & \bs & ao &  & A & \sr & \lt & \bs & \bs & \lt \\
 Something22 & \lt & \bs & \lt & \bs & \lt & \bs & \bs & \lt & \bs & \lt & \bs & \sr & \bs & \sr & \sr & \bs & ao &  & A & \sr & \lt & \bs & \bs & \lt \\
    \bottomrule
\end{tabular}
\end{landscape}
    \end{document}

enter image description here

Related Question