1

I want to place a table at the top of the page. I have tried using the answer provided here:

Placing the figure exactly at the top of the page in Latex

However, this did not provide the expected response and the table remains below the top of the page.

enter image description here

 \documentclass[10pt]{article}

\makeatletter
\setlength{\@fptop}{0pt}
\setlength{\@fpbot}{0pt plus 1fil}
\makeatother


\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage[english]{babel}
\usepackage{adjustbox}      
\usepackage{booktabs}


\begin{document}


\begin{table}[t!] \caption{This is a nice table} \label{tab:instruments}
\begin{adjustbox}{max width=1.5\textwidth, center }
   \begin{tabular}
      {p{5cm}p{2cm}p{5cm}p{1cm}p{5cm}} \hline Instrument & Resolution & Caption & Date & Figure \\   

\hline 

Speybroeck's X-Ray Telescope  &  10 & First X-Ray Images of the Sun  \cite{vanspeybroeck1970}  & 1970 & {\raisebox{-.5\height}{\includegraphics[width=3.5cm]{figure}}\\   

Brueckner Sounding Rockets &  No Data & Early observations of jets \cite{brueckner1983}  & 1983 & {\raisebox{-.5\height}{\includegraphics[width=3.5cm]{figure}}\\   

Yohkoh/SXT & 5   & Observations using SXT \cite{shibata1992} & 1992 & {\raisebox{-.5\height}{\includegraphics[width=3.5cm]{figure}}\\   

      SOHO & 2.5 & Description & Date & {\raisebox{-.5\height}{\includegraphics[width=3.5cm]{figure}}\\   

      Hinode/XRT & 1.028 & Description & Date & {\raisebox{-.5\height}{\includegraphics[width=3.5cm]{figure}}\\   

      STERO & 1.6   & Description & Date & {\raisebox{-.5\height}{\includegraphics[width=3.5cm]{figure}}\\   

      SDO/AIA & 0.6  & Description & Date & {\raisebox{-.5\height}{\includegraphics[width=3.5cm]{figure}}\\   

      Solar Orbiter (proposed) & 0.05 & Description & Date & {\raisebox{-.5\height}{\includegraphics[width=3.5cm]{figure}}\\   


          \hline
  \end{tabular}

\end{adjustbox}
\end{table}

\end{document}
  • your table is to tall to be fit in one page. this cause your problems with its placing on the top of a page. See, if the longtable solve your problem or split table manually into two parts – Zarko Jan 29 '17 at 0:36
  • 1
    Don't use adjustbox with tables, they generally will become unreadable. – Bernard Jan 29 '17 at 0:42
2

See, if the following solution is acceptable to you:

\documentclass[10pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[demo]{graphicx}
\usepackage[english]{babel}
\usepackage[export]{adjustbox}% <-- added option "export"

\usepackage{caption} % <-- added
\usepackage{siunitx} % <-- added
\usepackage{ragged2e}% <-- added
\usepackage{booktabs, 
            tabularx}% <-- added
\newcolumntype{L}{>{\RaggedRight\arraybackslash}X}
\newcolumntype{C}{>{\centering\arraybackslash}X}

\makeatletter
\setlength{\@fptop}{0pt}
\setlength{\@fpbot}{0pt plus 1fil}
\makeatother

\usepackage{lipsum}     % <-- for dummy text
\usepackage{showframe}  % <-- to show page layout
\renewcommand*\ShowFrameColor{\color{teal}}

\begin{document}
\lipsum[11]
    \begin{table}[t!] 
    \centering
\caption{This is a nice table} \label{tab:instruments}
   \begin{tabularx}{\textwidth}{@{}L S L l C@{}}
    \hline 
Instrument & {Resolution} & Caption & Date & Figure \\
    \hline
Speybroeck's X-Ray Telescope  
        &  10 
        & First X-Ray Images of the Sun \cite{vanspeybroeck1970}
        & 1970
        & \includegraphics[width=\linewidth,valign=m,margin=0pt 1pt]{figure}\\
Brueckner Sounding Rockets 
        &  {No Data} 
        & Early observations of jets \cite{brueckner1983}
        & 1983
        & \includegraphics[width=\linewidth,valign=m,margin=0pt 1pt]{figure}\\
Yohkoh/SXT 
        & 5
        & Observations using SXT \cite{shibata1992}
        & 1992
        & \includegraphics[width=\linewidth,valign=m,margin=0pt 1pt]{figure}\\
SOHO    & 2.5
        & Description
        & Date
        & \includegraphics[width=\linewidth,valign=m,margin=0pt 1pt]{figure}\\
    \hline
    \end{tabularx}
\end{table}
%
\begin{table}[t!]
\ContinuedFloat
    \centering
\caption{This is a nice table (cont.)}
   \begin{tabularx}{\textwidth}{@{}L S L l C@{}}
    \hline
Hinode/XRT 
        & 1.028 
        & Description 
        & Date 
        & \includegraphics[width=\linewidth,valign=m,margin=0pt 1pt]{figure}\\
STERO   & 1.6   
        & Description 
        & Date 
        & \includegraphics[width=\linewidth,valign=m,margin=0pt 1pt]{figure}\\
SDO/AIA & 0.6  
        & Description 
        & Date 
        & \includegraphics[width=\linewidth,valign=m,margin=0pt 1pt]{figure}\\
Solar Orbiter (proposed) 
        & 0.05 
        & Description 
        & Date 
        & \includegraphics[width=\linewidth,valign=m,margin=0pt 1pt]{figure}\\
    \hline
    \end{tabularx}
\end{table}
\lipsum[1]
\end{document}

I split table manually to two parts, add packages ragged2e for better adjusting cells contents, caption for continuation of floats, siunitx for align numbers of resolution and tabularx for fit table in text width. With option export in package adjustbox are vertically centered images as well added top/bottom margins to them:

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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