1

Hey I have 5 tables that I want to be laid out in a certain way. I can't really think of a way to ask this question but the issue is each table vertically centers itself to the bigger table. How do I stop this, let alone control vertical spacing on tables before and after it? Any help is much appreciated.

Expectation:

enter image description here

MWE:

\documentclass{article}
\usepackage[table]{xcolor}
\usepackage[letterpaper, inner=16mm, outer=16mm, top=8mm, bottom=8mm]{geometry} 
\usepackage{tabularx}
\usepackage{graphicx}
\usepackage[scaled]{helvet}
\renewcommand\familydefault{\sfdefault}
\rowcolors{1}{}{gray!15} 
                                        
\begin{document}

\noindent\begin{minipage}{2.3in}
                \begin{tabularx}{\textwidth}{m{3cm}XX}
                \rowcolor{black}
                    \multicolumn{3}{c}{\centering\color{white}\fontsize{6pt}{6pt}\selectfont Header } \\
                \rowcolor{black!60}
                    \color{black!60}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black!60}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black!60}\fontsize{6pt}{6pt}\selectfont  \\ 

                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  \\         
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  \\ 

                    \end{tabularx}
\end{minipage}
\quad
\noindent\begin{minipage}{2.3in}
  
                \begin{tabularx}{\textwidth}{m{3cm}XX}
                \rowcolor{black}
                    \multicolumn{3}{c}{\centering\color{white}\fontsize{6pt}{6pt}\selectfont Header } \\
                \rowcolor{black!60}
                    \color{black!60}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black!60}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black!60}\fontsize{6pt}{6pt}\selectfont  \\ 

                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  \\         
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  \\ 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  \\ 

                    \end{tabularx}
\end{minipage}
\quad
\noindent\begin{minipage}{2.3in}
                \begin{tabularx}{\textwidth}{m{3cm}XX}
                \rowcolor{black}
                    \multicolumn{3}{c}{\centering\color{white}\fontsize{6pt}{6pt}\selectfont Header } \\
                \rowcolor{black!60}
                    \color{black!60}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black!60}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black!60}\fontsize{6pt}{6pt}\selectfont  \\ 

                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  \\         
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  \\ 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  \\ 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  \\ 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  \\ 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  \\ 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  \\ 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  \\ 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  \\ 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  \\             
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  \\ 
                    \end{tabularx}
\end{minipage}
\quad
\noindent\begin{minipage}{2.3in}
                \begin{tabularx}{\textwidth}{m{3cm}XX}
                \rowcolor{black}
                    \multicolumn{3}{c}{\centering\color{white}\fontsize{6pt}{6pt}\selectfont Header } \\
                \rowcolor{black!60}
                    \color{black!60}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black!60}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black!60}\fontsize{6pt}{6pt}\selectfont  \\ 

                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  \\         
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  \\ 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  \\ 

                    \end{tabularx}
\end{minipage}
\quad
\noindent\begin{minipage}{2.3in}
                \begin{tabularx}{\textwidth}{m{3cm}XX}
                \rowcolor{black}
                    \multicolumn{3}{c}{\centering\color{white}\fontsize{6pt}{6pt}\selectfont Header } \\
                \rowcolor{black!60}
                    \color{black!60}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black!60}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black!60}\fontsize{6pt}{6pt}\selectfont  \\ 

                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  \\         
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  \\ 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  \\ 

                    \end{tabularx}
                \end{minipage}
\end{document}

1 Answer 1

1

With a combination of three top ailgned minipages with two or one tabularx and \raisebox in order to top align the tabularx environments:

enter image description here

\documentclass{article}
\usepackage[table]{xcolor}
\usepackage[letterpaper, inner=16mm, outer=16mm, top=8mm, bottom=8mm]{geometry} 
\usepackage{tabularx}
\usepackage{graphicx}
\usepackage[scaled]{helvet}
\renewcommand\familydefault{\sfdefault}
\rowcolors{1}{}{gray!15} 
                                        
\begin{document}

\noindent\begin{minipage}[t]{2.3in}
\raisebox{-\height}{
                \begin{tabularx}{\textwidth}{m{3cm}XX}
                \rowcolor{black}
                    \multicolumn{3}{c}{\centering\color{white}\fontsize{6pt}{6pt}\selectfont Header } \\
                \rowcolor{black!60}
                    \color{black!60}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black!60}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black!60}\fontsize{6pt}{6pt}\selectfont  \\ 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  \\         
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  \\ 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  \\ 

                    \end{tabularx}}
                    \medskip
                    
                \raisebox{-\height}{\begin{tabularx}{\textwidth}{m{3cm}XX}
                \rowcolor{black}
                    \multicolumn{3}{c}{\centering\color{white}\fontsize{6pt}{6pt}\selectfont Header } \\
                \rowcolor{black!60}
                    \color{black!60}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black!60}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black!60}\fontsize{6pt}{6pt}\selectfont  \\ 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  \\         
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  \\ 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  \\ 

                    \end{tabularx}}
\end{minipage}
\quad
\begin{minipage}[t]{2.3in}
  
                \raisebox{-\height}{\begin{tabularx}{\textwidth}{m{3cm}XX}
                \rowcolor{black}
                    \multicolumn{3}{c}{\centering\color{white}\fontsize{6pt}{6pt}\selectfont Header } \\
                \rowcolor{black!60}
                    \color{black!60}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black!60}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black!60}\fontsize{6pt}{6pt}\selectfont  \\ 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  \\         
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  \\ 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  \\

                    \end{tabularx}}
                    \medskip
                    
               \raisebox{-\height}{\begin{tabularx}{\textwidth}{m{3cm}XX}
                \rowcolor{black}
                    \multicolumn{3}{c}{\centering\color{white}\fontsize{6pt}{6pt}\selectfont Header } \\
                \rowcolor{black!60}
                    \color{black!60}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black!60}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black!60}\fontsize{6pt}{6pt}\selectfont  \\ 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  \\         
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  \\ 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  \\
                    \end{tabularx}}
\end{minipage}
\quad
\begin{minipage}[t]{2.3in}
                \raisebox{-\height}{\begin{tabularx}{\textwidth}{m{3cm}XX}
                \rowcolor{black}
                    \multicolumn{3}{c}{\centering\color{white}\fontsize{6pt}{6pt}\selectfont Header } \\
                \rowcolor{black!60}
                    \color{black!60}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black!60}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black!60}\fontsize{6pt}{6pt}\selectfont  \\ 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  \\         
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  \\ 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  \\ 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  \\ 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  \\ 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  \\ 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  \\ 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  \\ 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  \\ 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  \\             
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  & 
                    \color{black}\fontsize{6pt}{6pt}\selectfont  \\ 
                    \end{tabularx}}
\end{minipage}
\end{document}
1
  • I was researching the [t] but I didn't know you could use it in minipage. Very good job friend, am eternally grateful.
    – tblev
    Jun 26, 2020 at 18:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .