1

I created a long table in tex studio which does not complete i.e. it trys to fit itself with in one page and dump itself with in the page. Actually it should continue in the next page but rather its not creating the complete table.

I also added my code and table for the reference.

\documentclass[]{article}
\usepackage{enumitem}
\usepackage{booktabs}
\usepackage{array}

\usepackage[demo]{graphicx} % to add pictures
\usepackage{caption}%to use caption under picture
\usepackage{float}%picture was going to next page
\usepackage{enumitem}
\begin{document}
    \begin{table}[H]
        \centering 
        \begin{tabular}{  >{\raggedright}m{7cm} | m{3cm} | m{3cm}  }      % centered columns (3 columns) 
            \toprule                                %inserts double horizontal lines 
            Description  & Cost per 5 pack & Sensor \\  % inserts table heading 
            \midrule\addlinespace[1.5ex]
            \begin{itemize}
                \item For fair weather application
                \item Operational temperature: 0${}^\circ$C to 65${}^\circ$C
                \item Real time automatic calibration of voltage,humidity and ambient noise
                \item Max range: 7 m (300cm) at 5V
                \item 6 m (600cm) at 3.3 V
                \item Min range: 0.2 m (20cm)
            \end{itemize}

            & \$ 174.75 & MB1240 \includegraphics[height=1.2in]{Figure/fig28} \\ \hline

            \begin{itemize}
                \item   IP67 rated for rain and inclement weather application
                \item   Operational temperature: -40${}^\circ$C to 65${}^\circ$C
                \item   Real time automatic calibration and noise rejection
                \item   Max range: 7 m (300cm) at 5V
                \item   6 m (600cm) at 3.3 V
                \item   Min range: 0.2 m (20cm)
            \end{itemize}

            & \$ 474.75 & MB7060 \includegraphics[height=1.2in]{Figure/fig29} \\ \hline

            \begin{itemize}
                \item   IP67 rated in an extra light and compact form factor
                \item   Weight: 18 gm
                \item   Operational temperature: -40${}^\circ$C to 65${}^\circ$C
                \item   Real time automatic calibration and noise rejection
                \item   Max range: 7 m (300cm) at 5V
                \item   6 m (600cm) at 3.3 V
                \item   Min range: 0.2 m (20cm)
            \end{itemize} 
            & \$ Not Available 
            & MB7267 \includegraphics[height=1.2in]{Figure/fig30} \\
             \hline


            \begin{itemize}
                \item   With I2C interface for fair weather application
                \item   I2C bus communication allows rapid control of multiple sensors with only two wires
                \item   Operational temperature: 0oC to 65oC
                \item   Real time automatic calibration and noise rejection
                \item   Max range: 7 m
                \item   Min range: 0.2 m (20cm)

            \end{itemize}
            & \$ 174.75
            & MB1242 \includegraphics[height=1.2in]{Figure/fig28} \\ \hline

            \begin{itemize}
                \item   With I2C interface for inclement weather application
                \item   I2C bus communication allows rapid control of multiple sensors with only two wires
                \item   Operational temperature: -40${}^\circ$C to 65${}^\circ$C
                \item   Real time automatic calibration and noise rejection
                \item   Max range: 7 m
                \item   Min range: 0.2 m (20cm) 
            \end{itemize}


            & \$ 474.75 
            & MB7040 \includegraphics[height=1.2in]{Figure/fig29} \\ 

            \bottomrule
        \end{tabular}
        \caption{**********Yet to decide**********}
        \label{tab:ultraCost}
    \end{table}

\end{document}

1

Well, there are two problems in your code.

First: you need environment longtable to get tables over more than one page(s). Second: your table is too wide. I guess you forgot the paper margins (in the following MWE I added package showframe to visualise the typing area and the margins).

I changed your code now using package and environment longtable (please have a look to the comments). Tables should have there table header at the beginning of the table. Please read the documentaion of package longtable with typing texdoc longtable into your console/terminal window.

I changed the width of your table columns to have the table only written a little bit into the margins. Change the values for your needs ...

MWE (with little pretty printing):

\documentclass[]{article}
\usepackage{enumitem}
\usepackage{booktabs}
\usepackage{longtable,showframe} % <====================================
\usepackage{array}

\usepackage[demo]{graphicx} % to add pictures
\usepackage{caption}%to use caption under picture
\usepackage{float}%picture was going to next page
\usepackage{enumitem}
\begin{document}
%\begin{tabular}{>{\raggedright}m{7cm}|m{3cm}|m{3cm}}      % centered columns (3 columns) 
\begin{longtable}{>{\raggedright}p{6cm}|p{1.5cm}|p{3cm}}
  \caption{**********Yet to decide**********}
  \label{tab:ultraCost}                     \\ 
  \toprule
  Description  & Cost per 5 pack & Sensor          \\ 
  \midrule
\endfirsthead  % end first head
  \caption*{Yet to decide~-- continued}       \\ 
  \toprule
  Description  & Cost per 5 pack & Sensor          \\ 
  \midrule
\endhead % End head
  \midrule
  \multicolumn{3}{c}{continued on next page \dots} \\ 
\endfoot % End foot
  \bottomrule
\endlastfoot % End last foot

\addlinespace[1.5ex]
\begin{itemize}
  \item For fair weather application
  \item Operational temperature: 0${}^\circ$C to 65${}^\circ$C
  \item Real time automatic calibration of voltage,humidity and ambient noise
  \item Max range: 7 m (300cm) at 5V
  \item 6 m (600cm) at 3.3 V
  \item Min range: 0.2 m (20cm)
\end{itemize}
  & \$ 174.75 & MB1240 \includegraphics[height=1.2in]{Figure/fig28} \\

\begin{itemize}
  \item IP67 rated for rain and inclement weather application
  \item Operational temperature: -40${}^\circ$C to 65${}^\circ$C
  \item Real time automatic calibration and noise rejection
  \item Max range: 7 m (300cm) at 5V
  \item 6 m (600cm) at 3.3 V
  \item Min range: 0.2 m (20cm)
\end{itemize}
  & \$ 474.75 & MB7060 \includegraphics[height=1.2in]{Figure/fig29} \\

            \begin{itemize}
                \item   IP67 rated in an extra light and compact form factor
                \item   Weight: 18 gm
                \item   Operational temperature: -40${}^\circ$C to 65${}^\circ$C
                \item   Real time automatic calibration and noise rejection
                \item   Max range: 7 m (300cm) at 5V
                \item   6 m (600cm) at 3.3 V
                \item   Min range: 0.2 m (20cm)
            \end{itemize} 
            & \$ Not Available 
            & MB7267 \includegraphics[height=1.2in]{Figure/fig30} \\
             \hline


            \begin{itemize}
                \item   With I2C interface for fair weather application
                \item   I2C bus communication allows rapid control of multiple sensors with only two wires
                \item   Operational temperature: 0oC to 65oC
                \item   Real time automatic calibration and noise rejection
                \item   Max range: 7 m
                \item   Min range: 0.2 m (20cm)

            \end{itemize}
            & \$ 174.75
            & MB1242 \includegraphics[height=1.2in]{Figure/fig28} \\ \hline

\begin{itemize}
  \item With I2C interface for inclement weather application
  \item I2C bus communication allows rapid control of multiple sensors with only two wires
  \item Operational temperature: -40${}^\circ$C to 65${}^\circ$C
  \item Real time automatic calibration and noise rejection
  \item Max range: 7 m
  \item Min range: 0.2 m (20cm) 
\end{itemize}
  & \$ 474.75 
  & MB7040 \includegraphics[height=1.2in]{Figure/fig29} \\ 
\end{longtable}
\end{document}

and the result:

resulting first page

0

As supplement to the other answer: your table can be improved with:

  • use capability of enumitem package
  • redefine column with with respect to text width
  • use siunitx for all units in table
  • delete vertical lines end increase vertical space between rows with \addlinespace
  • increase text area to default size determined by use of geomtry package

With all this measures the table is still to wide. To fit it in text width you have two options: (i) increase text width (if possible) or (ii) reduce size of images (instead of width rather determine width of them: includegraphics[width=\linewidth]{...})

\documentclass[]{article}
\usepackage{array,booktabs}
\usepackage{longtable}

\usepackage[showframe]{geometry}% <-- default text area is now greater 
\usepackage{siunitx}            % <-- for units in text/table

\usepackage[demo]{graphicx} % to add pictures
\usepackage{caption}%to use caption under picture
%\usepackage{float}%picture was going to next page
\usepackage{enumitem}

\begin{document}
\setlist[itemize]{nosep, topsep=0pt, partopsep =0pt, leftmargin=*, 
                  before=\vspace{-\baselineskip},
                  after =\vspace{-\baselineskip}
                  }
\setlength\tabcolsep{4pt}
\begin{longtable}{%
    >{\raggedright}p{\dimexpr 5\linewidth/9-2\tabcolsep\relax}
    >{\raggedright}p{\dimexpr 1\linewidth/9-2\tabcolsep\relax}
                   p{\dimexpr 3\linewidth/9-2\tabcolsep\relax}
                  }
  \caption{**********Yet to decide**********}
  \label{tab:ultraCost}                             \\
  \toprule
  Description  & Cost per 5 pack & Sensor          \\
  \midrule
\endfirsthead  % end first head
  \caption*{Yet to decide -- continued}             \\
  \toprule
  Description  & Cost per 5 pack & Sensor           \\
  \midrule
\endhead % End head
  \midrule
  \multicolumn{3}{c}{continued on next page \dots}  \\
\endfoot % End foot
  \bottomrule
\endlastfoot % End last foot

\addlinespace[1.5ex]
\begin{itemize}
  \item For fair weather application
  \item Operational temperature: \SIrange{0}{65}{\celsius}
  \item Real time automatic calibration of voltage, humidity and ambient noise
  \item Max range: \SI{7}{m} (\SI{300}{cm}) at \SI{5}{V}
  \item \SI{6}{m} (\SI{600}{cm}) at \SI{3.3}{V}
  \item Min range: \SI{0.2}{m} (\SI{20}{cm})
\end{itemize}
  & \$ 174.75   & MB1240 \includegraphics[height=1.2in]{Figure/fig28}     \\
  \addlinespace
%
\begin{itemize}
    \item For fair weather application
    \item Operational temperature: \SIrange{0}{65}{\celsius}
    \item Real time automatic calibration of voltage, humidity and ambient noise
    \item Max range: \SI{7}{m} (\SI{300}{cm}) at \SI{5}{V}
    \item \SI{6}{m} (\SI{600}{cm}) at \SI{3.3}{V}
    \item Min range: \SI{0.2}{m} (\SI{20}{cm})
\end{itemize}
    & \$ 474.75   & MB7060 \includegraphics[height=1.2in]{Figure/fig29}       \\
  \addlinespace
%
\begin{itemize}
    \item For fair weather application
    \item Operational temperature: \SIrange{0}{65}{\celsius}
    \item Real time automatic calibration of voltage, humidity and ambient noise
    \item Max range: \SI{7}{m} (\SI{300}{cm}) at \SI{5}{V}
    \item \SI{6}{m} (\SI{600}{cm}) at \SI{3.3}{V}
    \item Min range: \SI{0.2}{m} (\SI{20}{cm})
\end{itemize}
    & \$ Not Available
                & MB7267 \includegraphics[height=1.2in]{Figure/fig30}       \\
  \addlinespace
%
\begin{itemize}
    \item   With I2C interface for fair weather application
    \item   I2C bus communication allows rapid control of multiple sensors with only two wires
    \item   Operational temperature: \SIrange{0}{65}{\celsius}
    \item   Real time automatic calibration and noise rejection
    \item Max range: \SI{7}{m} (\SI{300}{cm}) at \SI{5}{V}
    \item Min range: \SI{0.2}{m} (\SI{20}{cm})
\end{itemize}
    & \$ 174.75 & MB1242 \includegraphics[height=1.2in]{Figure/fig28}       \\ 
  \addlinespace
%
\begin{itemize}
    \item With I2C interface for inclement weather application
    \item I2C bus communication allows rapid control of multiple sensors with only two wires
    \item Operational temperature: \SIrange{-50}{65}{\celsius}
    \item Real time automatic calibration and noise rejection
    \item Max range: \SI{7}{m} (\SI{300}{cm}) at \SI{5}{V}
    \item Min range: \SI{0.2}{m} (\SI{20}{cm})
\end{itemize}
    & \$ 474.75 & MB7040 \includegraphics[height=1.2in]{Figure/fig29}       \\
\end{longtable}
\end{document}

With above MWE the first table row is:

enter image description here

and with with decreasing image size to available space in column:

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.