0

I'm having issues with transforming long table into two adjacent colums. The code looks like this:

    {\renewcommand\arraystretch{1.0}
    \noindent\begin{longtable*}{@{}l @{\quad=\quad} l@{}}
    $1$             & a\\
    $2$           & b\\
    $3$           & c\\
    $4$             & d\\
    $5$           & e\\
    $6$           & f\\
    $7$             & g\\
    $8$           & h\\
    $9$           & i\\
    $10$             & j\\
    \end{longtable*}}

The desirable output is two-adjacent tables with 5 rows in each one.

Thanks in advance! :)

1
  • Welcome to TeX.SE! is your table really long table? From your code snippet this is not so obvious). Please extend it to complete small document with your table, which begins with \document{class and end with \end{document}˙˙. BTW, longtable*` doesn't exist.
    – Zarko
    Jan 7, 2022 at 13:32

1 Answer 1

1
  • It is impossible to have two long tables in parallel
  • Regarding your code fragment, you should be aware that
    • longtable* doesn't exist. Exist only table*orfigure` floats environments in which you can enclose (short) tables or images. Thpse floats spam two columns in document and apear at top of the next page from insertion point.
    • longtable is always horizontally centered in text area. For flus left it you need to set (in preamble)
\setlength\LTleft
\setlength\LTright\fill

or simpler

\begin{longtable}[l]{...}
  • The command \renewcommand\arraystretch{1.0} hasn't any sence. Default array stretch is 1.
  • longtable has defined firsthead head, foot and lastfoot ... do you need them?

Your "longtable" can be extend to quasi in parallel tables on the following way:

\documentclass[12pt]{article}
\usepackage[showframe, % deleta this option in real document
            vmargin=63mm, hmargin=33mm]{geometry}
\usepackage{longtable}
\usepackage{lipsum}

\begin{document}
\lipsum[1-3]

\begin{longtable}{@{} l l @{\qquad} l l @{}}
    $1$         & a     &   $2$         & b\\
    $3$         & c     &   $4$         & d\\
    $5$         & e     &   $6$         & f\\
    $7$         & g     &   $8$         & h\\
    $9$         & i     &   $10$        & j\\
    \end{longtable}

    
\begin{table}[ht]
\centering
\begin{tabular}{ ll }
\hline
    $1$           & a\\
    $2$           & b\\
    $3$           & c\\
    $4$           & d\\
    $5$           & e\\
\hline
\end{tabular}
\quad % if needed space between table
\begin{tabular}{ ll }
\hline
    $6$           & f\\
    $7$           & g\\
    $8$           & h\\
    $9$           & i\\
    $10$          & j\\
\hline
\end{tabular}
\end{table}

\end{document}

enter image description here

(gray lines indicate page layout)

2
  • simpler to use [l] to get flush left longtable (not that that helps get two side by side) Jan 7, 2022 at 14:04
  • @DavidCarlisle, thank you very much to remained me for this! Happy New Year!
    – Zarko
    Jan 7, 2022 at 14:34

You must log in to answer this question.

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