2

I'm trying to build a big latex table. The table has 30 columns. I use \longtable in latex in this code for the table that I'm presenting to you. Can anyone help me reproduce the large table as in the picture that I realized on the Word landscape page? I would like repeating table header in case the table continues to the next page in latex.

\documentclass{article}
\usepackage{graphicx} % Required for inserting images
\usepackage{pdflscape} % for 'landscape' environment
\usepackage{longtable}

\title{test-lontable}
\author{emile nana}
\date{February 2024}

\begin{document}

\maketitle

\section{Introduction}
\begin{landscape}
\begin{longtable}{|p{0.2cm}|p{0.2cm}|p{0.2cm}|p{0.2cm}|p{0.2cm}|p{0.2cm}|p{0.2cm}|p{0.2cm}|p{0.2cm}|p{0.2cm}|p{0.2cm}|p{0.2cm}|p{0.2cm}|p{0.2cm}|p{0.2cm}|p{0.2cm}|p{0.2cm}|p{0.2cm}|p{0.2cm}|p{0.2cm}|p{0.2cm}|p{0.2cm}|p{0.2cm}|p{0.2cm}|p{0.2cm}|p{0.2cm}|p{0.2cm}|p{0.2cm}|p{0.2cm}|p{0.2cm}|}
        \hline
        Products & Licence &     & Visualization &   & Programming language &   Coding  &   &   & behavior &  &  &  watch type &     &  Flow mode &  &   & Look &   &   & Area  &   &   & Happy & & &Output data &  Popularity Out of 10 &  Version &   Error \\
        \hline
        \textbf{AAAAAAAAAA} & & X & X & X & Java, Python, C++ & & X & &
X & & & X & & X & & & X & & & & & & & X & & Charts & 2 & 8.8.4 of June
19, 2023 & you can still download them or view the raw  \\
        \hline
\textbf{AAAAAAAAAA} & & X & X & X & C++, VB, Matlab, Python &
X & & & X & & & X & X & X & & & X & & & & & & X & & & XML & 4 & 12.0.0
from March 2023 & you can still download them or view the raw  \\ 
\hline
\textbf{AAAAAAAAAA} & & X & X & X & Python, C++ & & & X & X & &
& & X & X & X & X & X & & & & X & X & X & & & Graph & 4 & 23.1.0 from
August 2023 & you can still download them or view the raw  \\ 
\hline
\textbf{AAAAAAAAAA} & X & & X & & C++, VB, Matlab, Python & & &
X & X & & & & X & X & & & X & & & X & X & & X & & & XML & 4 & 1.18.0
from June 29, 2023 & you can still download them or view the raw  \\ 
\hline
\textbf{AAAAAAAAAA} & X & & X & & C++, JAVA & X & & & & X & & & X
& X & & & X & & & X & X & & X & & & Text & 3 & 14.0 from June 2023 &
you can still download them or view the raw  \\ 
\hline
\textbf{AAAAAAAAAA} & X & & X & X & GAML & X & & & X & & & & X & X &
& X & X & & & & & & X & & & Charts, Graphs & 2 & 1.9.2 from September
2023 & you can still download them or view the raw  \\ 
\hline 
\textbf{AAAAAAAAAA} & & X & X & X & C++, VB, Matlab, Python & &
& X & X & & & & & X & & & X & & & X & X & & X & & & Graphs & 2 & 24.0.4
of August 2023 & you can still download them or view the raw  \\
\hline
\textbf{AAAAAAAAAA} & X & & X & & C++, VB, Matlab, Python & &
X & X & & & X & & & X & X & & & & & & X & X & X & & & XML & 3 & 6.1.12
of December 2022 & you can still download them or view the raw  \\ 
\hline
\textbf{AAAAAAAAAA} & & X & X & X & Python, C++ & & & X & & & X & X
& & & & X & X & & & X & X & & X & X & & Text, XML, CSV & 2 & 7.2 from
September 2023 & you can still download them or view the raw  \\ 
\hline
\textbf{AAAAAAAAAA} & & X & X & X & Python, C++, Java, C\# & & & X
& & & & X & X & X & & & X & & & & & & X & X & & Graph, charts & 1 &
1.2.3 from September 2023 & you can still download them or view the raw  \\ 
\hline 
\textbf{AAAAAAAAAA} & & X & X & & C++, Python & X & &
& X & & & X & X & X & & & X & & & & & & X & & & Graph, charts & 1 &
16.2.3 of September 2023 & you can still download them or view the raw  \\ 
\hline
\textbf{AAAAAAAAAA} & X & & X & & C++, Python & & X & & X & & & X & X & X &
& & X & & & & & & X & & & Graph, charts & 1 & 2.0 from August 4, 2023 &
you can still download them or view the raw  \\ 
\hline
\textbf{AAAAAAAAAA} & X & & X & X & Python & & X & & & & X & X &
X & & X & & X & & & & & & X & & & CSV & 2 & 3.1.0 from August 4, 2023 &
you can still download them or view the raw  \\ 
\hline
\textbf{AAAAAAAAAA} & & X & X & X & C++, Python & X & & & X &
& & X & & X & & & X & & & & & & X & & & Graph, charts & 2 & 5.3.0 from
February 15, 2023 & you can still download them or view the raw \\ 
\hline
\textbf{AAAAAAAAAA} & X & & X & & Python & X & & & & & & X & X & X & & & X & &
& & & & X & & & Graph, charts & & 1.13.2 of September 21, 2023 &
you can still download them or view the raw  \\
        \hline
\textbf{AAAAAAAAAA} & & X & X & X & Python, C\#, VB, VBS, JS & & X
& & X & & & X & X & X & X & & X & & & & & & X & & & Graphs, Charts & 1 &
6.1.0 from August 4, 2023 & you can still download them or view the raw  \\
        \hline
\textbf{AAAAAAAAAA} & & X & X & & Python & & X & & & & & & X & X & &
& X & & & & & & X & & & CSV, XML, JSON & 1 & 3.0.1 from Feb 28, 2023 &
you can still download them or view the raw  \\
        \hline
\textbf{AAAAAAAAAA} & X & & X & & Python & & X & & & X & & & X & X & & &
X & & & X & & & X & & & Charts & 2 & 7.1.2 from Sep 15, 2023 & you can still download them or view the raw \\
        \hline
\textbf{AAAAAAAAAA} & X & & X & X & C++, Python & X & & & X & & &
X & X & X & & & X & & & X & X & X & X & & & Graphs & 2 & 3.1.1 from Oct
2023 & you can still download them or view the raw for no comment \\
        \hline
\textbf{AAAAAAAAAA} & X & & X & X & Python, C++, Java,
JavaScript, SQL, R & X & & & X & & & & X & & X & & X & & & & & X & & & &
Graphs, charts & 2 & 3.13.1 of Sep 19, 2023 & you can still download them or view the raw  \\
        \hline
\textbf{AAAAAAAAAA} & & X & & X & Python & & & & X & & & & X
& X & & & X & & & & & & X & & & Graphs & 3 & 1.2.1 from Sep 16, 2023 &
you can still download them or view the raw  \\
        \hline
\textbf{AAAAAAAAAA} & & X & X & X & Python & & X & & X & & & &
X & X & & & X & & & & & & X & & & Graphs & 2 & 7.1.2
from Sep 15, 2023 & you can still download them or view the raw  \\
        \hline
    \end{longtable}
    \end{landscape}
   

\end{document}

image of table that I would like to realize

When I follow your comments and orientation, I obtain this code that I present to you

\documentclass{article}
\usepackage{graphicx} % Required for inserting images
\usepackage{pdflscape} % for 'landscape' environment
\usepackage{longtable,booktabs}

\title{test-lontable}
\author{emile nana}
\date{February 2024}

\begin{document}

\maketitle

\section{Introduction}
\begin{landscape}
\begin{longtable}
{*{30}{p{0.2cm}|}}
\caption{My longtable} \\   \toprule
        \hline
        Products & Licence &     & Visualization &   & Programming language &   Coding  &   &   & behavior &  &  &  watch type &     &  Flow mode &  &   & Look &   &   & Area  &   &   & Happy & & &Output data &  Popularity Out of 10 &  Version &   Error \\ \midrule
        \endfirsthead
        \toprule
         Products & Licence &    & Visualization &   & Programming language &   Coding  &   &   & behavior &  &  &  watch type &     &  Flow mode &  &   & Look &   &   & Area  &   &   & Happy & & &Output data &  Popularity Out of 10 &  Version &   Error \\  \midrule
        \endhead
        \hline
        \multicolumn{2}{c}{Continued}\\   \bottomrule
        \endfoot
        \bottomrule
        \endlastfoot
        \textbf{AAAAAAAAAA} & & X & X & X & Java, Python, C++ & & X & &
X & & & X & & X & & & X & & & & & & & X & & Charts & 2 & 8.8.4 of June
19, 2023 & you can still download them or view the raw  \\
        \hline
\textbf{AAAAAAAAAA} & & X & X & X & C++, VB, Matlab, Python &
X & & & X & & & X & X & X & & & X & & & & & & X & & & XML & 4 & 12.0.0
from March 2023 & you can still download them or view the raw  \\ 
\hline
\textbf{AAAAAAAAAA} & & X & X & X & Python, C++ & & & X & X & &
& & X & X & X & X & X & & & & X & X & X & & & Graph & 4 & 23.1.0 from
August 2023 & you can still download them or view the raw  \\ 
\hline
\textbf{AAAAAAAAAA} & X & & X & & C++, VB, Matlab, Python & & &
X & X & & & & X & X & & & X & & & X & X & & X & & & XML & 4 & 1.18.0
from June 29, 2023 & you can still download them or view the raw  \\ 
\hline
\textbf{AAAAAAAAAA} & X & & X & & C++, JAVA & X & & & & X & & & X
& X & & & X & & & X & X & & X & & & Text & 3 & 14.0 from June 2023 &
you can still download them or view the raw  \\ 
\hline
\textbf{AAAAAAAAAA} & X & & X & X & GAML & X & & & X & & & & X & X &
& X & X & & & & & & X & & & Charts, Graphs & 2 & 1.9.2 from September
2023 & you can still download them or view the raw  \\ 
\hline 
\textbf{AAAAAAAAAA} & & X & X & X & C++, VB, Matlab, Python & &
& X & X & & & & & X & & & X & & & X & X & & X & & & Graphs & 2 & 24.0.4
of August 2023 & you can still download them or view the raw  \\
\hline
\textbf{AAAAAAAAAA} & X & & X & & C++, VB, Matlab, Python & &
X & X & & & X & & & X & X & & & & & & X & X & X & & & XML & 3 & 6.1.12
of December 2022 & you can still download them or view the raw  \\ 
\hline
\textbf{AAAAAAAAAA} & & X & X & X & Python, C++ & & & X & & & X & X
& & & & X & X & & & X & X & & X & X & & Text, XML, CSV & 2 & 7.2 from
September 2023 & you can still download them or view the raw  \\ 
\hline
\textbf{AAAAAAAAAA} & & X & X & X & Python, C++, Java, C\# & & & X
& & & & X & X & X & & & X & & & & & & X & X & & Graph, charts & 1 &
1.2.3 from September 2023 & you can still download them or view the raw  \\ 
\hline 
\textbf{AAAAAAAAAA} & & X & X & & C++, Python & X & &
& X & & & X & X & X & & & X & & & & & & X & & & Graph, charts & 1 &
16.2.3 of September 2023 & you can still download them or view the raw  \\ 
\hline
\textbf{AAAAAAAAAA} & X & & X & & C++, Python & & X & & X & & & X & X & X &
& & X & & & & & & X & & & Graph, charts & 1 & 2.0 from August 4, 2023 &
you can still download them or view the raw  \\ 
\hline
\textbf{AAAAAAAAAA} & X & & X & X & Python & & X & & & & X & X &
X & & X & & X & & & & & & X & & & CSV & 2 & 3.1.0 from August 4, 2023 &
you can still download them or view the raw  \\ 
\hline
\textbf{AAAAAAAAAA} & & X & X & X & C++, Python & X & & & X &
& & X & & X & & & X & & & & & & X & & & Graph, charts & 2 & 5.3.0 from
February 15, 2023 & you can still download them or view the raw \\ 
\hline
\textbf{AAAAAAAAAA} & X & & X & & Python & X & & & & & & X & X & X & & & X & &
& & & & X & & & Graph, charts & & 1.13.2 of September 21, 2023 &
you can still download them or view the raw  \\
        \hline
\textbf{AAAAAAAAAA} & & X & X & X & Python, C\#, VB, VBS, JS & & X
& & X & & & X & X & X & X & & X & & & & & & X & & & Graphs, Charts & 1 &
6.1.0 from August 4, 2023 & you can still download them or view the raw  \\
        \hline
\textbf{AAAAAAAAAA} & & X & X & & Python & & X & & & & & & X & X & &
& X & & & & & & X & & & CSV, XML, JSON & 1 & 3.0.1 from Feb 28, 2023 &
you can still download them or view the raw  \\
        \hline
\textbf{AAAAAAAAAA} & X & & X & & Python & & X & & & X & & & X & X & & &
X & & & X & & & X & & & Charts & 2 & 7.1.2 from Sep 15, 2023 & you can still download them or view the raw \\
        \hline
\textbf{AAAAAAAAAA} & X & & X & X & C++, Python & X & & & X & & &
X & X & X & & & X & & & X & X & X & X & & & Graphs & 2 & 3.1.1 from Oct
2023 & you can still download them or view the raw for no comment \\
        \hline
\textbf{AAAAAAAAAA} & X & & X & X & Python, C++, Java,
JavaScript, SQL, R & X & & & X & & & & X & & X & & X & & & & & X & & & &
Graphs, charts & 2 & 3.13.1 of Sep 19, 2023 & you can still download them or view the raw  \\
        \hline
\textbf{AAAAAAAAAA} & & X & & X & Python & & & & X & & & & X
& X & & & X & & & & & & X & & & Graphs & 3 & 1.2.1 from Sep 16, 2023 &
you can still download them or view the raw  \\
        \hline
\textbf{AAAAAAAAAA} & & X & X & X & Python & & X & & X & & & &
X & X & & & X & & & & & & X & & & Graphs & 2 & 7.1.2
from Sep 15, 2023 & you can still download them or view the raw  \\
        \hline
    \end{longtable}
    \end{landscape}
   

\end{document}
4
  • Instead of placing p{0.2cm}| in the column specification 20 times, you can simply write *{20}{p{0.2cm}|}. As for repeated header functionality, you should look into the longtable manual maybe. Look for \endhead. Commented Feb 13 at 12:15
  • I forgot: Welcome to TeX.SX! Commented Feb 13 at 12:22
  • @JasperHabicht did you meant {*{30}{p{0.2cm}|}} and moreover that the table declaration you then be \begin{longtable}{*{30}{p{0.2cm}|}} ? But I think that is not enough to answer emile nana need.
    – cProg
    Commented Feb 13 at 22:01
  • @JasperHabicht thank you so much. I want to realize table like in image
    – emile nana
    Commented Feb 13 at 22:21

1 Answer 1

2

Your table is very huge, so to make it some how readable you will have a hard time ...

Possible solution is (i) increase \textwidth and \textheight, (ii) rotate column headers that their text is better readable, i.e. table redesign as follows:

enter image description here

To achieve above design seems to be handy to use tabularray package as follows:

\documentclass{article}
\usepackage[margin=20mm]{geometry}
\usepackage{pdflscape}

\usepackage{ragged2e}
\usepackage{rotating}   % needed
\usepackage{makecell}   % needed

\usepackage{tabularray}
\usepackage{xcolor}
\usepackage{dingbat}
\newcommand\tcm{\textcolor{teal}{\checkmark}}% TealCheckMark

\begin{document}
    \begin{landscape}
    \settowidth\rotheadsize{Homogeneous}    % from makecell
\begin{longtblr}[
caption = {Huge long table},
  label = {tab:huge}
                ]{colsep  = 2pt,
                  colspec = {X[l]  *{4}{c} X[0.8, c] *{22}{c} X[l]  X[1.2, l]},
                  cell{1}{1}   = {r=2}{},
                  cell{1}{2,4,13} = {c=2}{},
                  cell{1}{7,10,15,18,21,24} = {c=3}{},
                  cell{1}{27-30} = {r=2}{cmd=\rotcell, font=\small},
                  row{1}  = {c, m}, % <----
                  row{2}  = {cmd=\rotcell, font=\small}, % <----
                  rowhead = 1,  hlines, vlines,
                  }
product
    & Licence 
        &  & Visual.
                &   & {Program.\\ language} 
                        & Coding
                            &   &   & behavior
    &   &   & {watch\\ type}
                &   & {Flow\\ mode}
                            &   &   & Look
                                        &   &  
    & Area
        &   &   & Happy 
                    &   &   & {Output\\ data} 
                                & {Popularity\\ Out of 10}
                                    & Version
                                        & Error \\
%
    & {Open source}
        & Commercial 
            & 2D
                & 3D
                    &   & Easy
                            & Average
                                & Difficult
                                    & Flexible
                                        
    & Limit
        & Very limited
            & Homogeneous
                & Heterpgenus
                    & Mesoscopic
                        & Macroscopic
                            & Macroscopic
                                & Yes
                                    
    & Maybe
        & No
            & City
                & Region
                    & Country
                        & Yeas
                            & Maybe
                                & No
                                    &   &   &   \\
AAAAAAA BBB CCCC
    &   & \tcm
            & \tcm
                & \tcm
                    & Java, Python, C++ 
                        &   & \tcm
                                &   & \tcm  
                                        &

    &   & \tcm
            &   & \tcm
                    &   &   & \tcm
                                &   &   &
    &   &   &   & \tcm
                    &   &  Charts
                            & 2 & 8.8.4 of June 19, 2023
                                    &  you can still download them or view the raw 
                                        \\

DDD EEEEEE  FF GGGGG 
    &   & \tcm 
            & \tcm 
                & \tcm 
                    & C++, VB, Matlab, Python 
                        & \tcm 
                            &   &   & \tcm 
                                        & 
    &   & \tcm 
            & \tcm 
                & \tcm 
                    &   &   & \tcm 
                                &   &   & 
    &   &   & \tcm 
                &   &   & XML 
                            & 4 & 12.0.0 from March 2023 
                                    & you can still download them or view the raw  \\
HHH II JJJJJJ KKK 
    &   & \tcm
            & \tcm
                & \tcm
                    & Python, C++ 
                        &   &   & \tcm
                                    & \tcm
                                        &   
    &   &   & \tcm
                & \tcm
                    & \tcm
                        & \tcm
                            & \tcm
                                &   &   
    &   & \tcm
            & \tcm
                & \tcm
                    &   &   & Graph
                                & 4 & 23.1.0 from August 2023
                                        & you can still download them or view the raw
                                        \\
\end{longtblr}
    \end{landscape}
\end{document}

Above MWE (Minimal Working Example) is only a skeleton which you can fill with your real data.

If obtained table will be longer than one page, to it will be automatically repeated column headers on the next page(s) and added information that table is continued on the next page.

You must log in to answer this question.

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