LaTeX table - extra alignment tab? - latex

I'm new to LaTeX and trying to make a truth table, but it won't compile. When I try to run the code, it says "Extra alignment tab has been changed to \cr." Here is my code:
\item (Textbook 1.1/38, 4 points) $((p\rightarrow q)\rightarrow r)\rightarrow s$
\begin{center}
\begin{tabular}{c|c|c|c|c|c}
\hline
$p$ & $q$ & $r$ & $s$ & $p\rightarrow q$ & $(p\rightarrow q)\rightarrow$ r & $((p\rightarrow q)\rightarrow r)\rightarrow s$ \\
\hline
T & T & T & T & T & T & T \\
T & T & T & F & T & T & F \\
T & T & F & T & T & F & T \\
T & F & T & T & F & T & T \\
T & F & T & F & F & T & F \\
T & F & F & T & F & T & T \\
T & F & F & F & F & T & F \\
F & T & T & T & T & T & T \\
F & T & T & F & T & T & F \\
F & T & F & T & T & F & T \\
F & T & F & F & T & F & T \\
F & F & T & T & T & T & T \\
F & F & T & F & T & T & F \\
F & F & F & T & T & F & T \\
F & F & F & F & T & F & T \\
\hline
\end{tabular}
\end{center}

Very easily, you declared six columns: there are six c in the line
\begin{tabular}{c|c|c|c|c|c}
Then, every line of your table has seven cells instead:
...
T & T & T & T & T & T & T \\
...
So, you should solve by changing
\begin{tabular}{c|c|c|c|c|c}
to
\begin{tabular}{c|c|c|c|c|c|c}
or
\begin{tabular}{c*{6}{|c}}

All you have to do is remove the \\ at the end of the last line of the truth table. I would also suggest trying out Overleaf it allows you to see your code in real time and gives an easier debugging experience.

Related

Is it possible to use multicolumn and multirow simultaneously in a single cell?

I'm trying to draw a table, but I faced a problem with the extra column line.
\documentclass[lettersize,journal]{IEEEtran}
\usepackage{array,tabularx}
\usepackage{pifont}
\usepackage{multirow,booktabs,tabu}
\begin{table*}[!t]
\caption{A. \label{table8}}
\centering
\begin{tabu}{|c|c|c|c|c|c|c|}
\hline
\multirow{2}{*}{A} & \multicolumn{2}{c|}{\multirow{2}{*}{B}} & \multicolumn{4}{c|}{C} \\
\cline{4-7}
& & & E & F & G & H \\
\cline{1-7}
\multirow{3}{*}{D} &
\multirow{3}{*}{K} & $1.0612e-09$ & $1.0610e-09$ & $5.2760e-10$ & $3.7844e-08$ & $7.6545e-06 $\\
\cline{3-7}
& & $9.724e-10$ & $9.7239e-10$ & $4.8758e-10$ & $4.9127e-08$ & $7.7153e-06 $\\
\cline{3-7}
& & $9.132e-10$ & $9.131e-10$ & $4.1633e-10$ & $4.3932e-08$ & $8.2672e-06$\\[-1pt]
%\cline{2-7
\hline
\end{tabu}
\end{table*}
Does anyone know how to remove this extra line that shown in
Don't use the tabu package - it is more or less completely broken. The only thing which helds this package together is a lot of ducktape by the latex team.
Instead you could use tabularray package, which makes merging cells much easier and you'll also don't have to worry how long all your lines should be.
You might also want to choose another column type, like S from siunitx, to avoid the incorrect spacing around your minus signs ....
\documentclass[lettersize,journal]{IEEEtran}
\usepackage{array,tabularx}
\usepackage{pifont}
\usepackage{multirow,booktabs,tabularray}
\UseTblrLibrary{siunitx}
\begin{document}
\begin{table*}[!t]
\caption{A. \label{table8}}
\centering
\begin{tblr}{
colspec={|c|c|S[table-format=1.3e-2]|S[table-format=1.3e-2]|S[table-format=1.3e-2]|S[table-format=1.3e-2]|S[table-format=1.3e-2]|},
vlines,
hlines,
row{1-2} = {guard}
}
\SetCell[r=2]{} A & \SetCell[c=2,r=2]{} B && \SetCell[c=4]{} C &&& \\
& & & E & F & G & H \\
\SetCell[r=3]{} D &
\SetCell[r=3]{} K & 1.0612e-09 & 1.0610e-09 & 5.2760e-10 & 3.7844e-08 & 7.6545e-06\\
& & 9.724e-10 & 9.7239e-10 & 4.8758e-10 & 4.9127e-08 & 7.7153e-06\\
& & 9.132e-10 & 9.131e-10 & 4.1633e-10 & 4.3932e-08 & 8.2672e-06\\
\end{tblr}
\end{table*}
\end{document}

Overleaf: How do I add another row in my table?

I have a longtable and I would like that both the first part and the second part of the table are identical. As you can see in the figure, on the first page you have a row "test (total) | test | test | test |Stest | test" . I would also like to see this on the second page (to increase readability of the table)
`
\documentclass[a4paper]{report}
\usepackage[a4paper, total={6in, 9in}]{geometry}
\usepackage{graphicx} % Required for box manipulation
\usepackage{helvet}
\usepackage{subfig}
\usepackage[utf8]{inputenc}
%\usepackage{natbib}
\usepackage[square, comma, sort&compress]{natbib}
\usepackage[USenglish]{babel}
\usepackage[useregional]{datetime2}
\usepackage{pgfgantt}
\usepackage{listings}
\usepackage{wrapfig}
\usepackage{setspace}
\usepackage{parskip} % Used to create spaces between paragraphs
\usepackage{dirtytalk} % quotes by talk
%\usepackage[hidelinks]{hyperref}
\usepackage[colorlinks=true,citecolor=red]{hyperref}
\usepackage[acronym, toc]{glossaries} % Used to add a wordlist/glossaries
\usepackage{mathtools}
\usepackage{amsfonts}
\usepackage{color, colortbl}
\usepackage{booktabs}
\usepackage{float}
\usepackage{csquotes}
%zelf toegevoegd
\usepackage[most]{tcolorbox}
\usepackage{multirow} %table
\usepackage{xcolor,colortbl}
\usepackage{pdflscape}
\usepackage{pifont} %%%bullet points
\usepackage{longtable}
\usepackage{graphicx}
%\usepackage{geometry} %table margin
\begin{longtable}{l|ccc|ccc|}
\caption{test}
\label{test}\\
\cline{2-7}
& \multicolumn{3}{c|}{\cellcolor{lightgray}\textbf{Duration test}} & \multicolumn{3}{c|}{\cellcolor{lightgray}\textbf{test(Count)}} \\ \hline
\endfirsthead
%
\multicolumn{7}{c}%
{{\bfseries Table \thetable\ continued from previous page}} \\
\cline{2-7}
& \multicolumn{3}{c|}{\cellcolor{lightgray}\textbf{Duration test)}} & \multicolumn{3}{c|}{\cellcolor{lightgray}\textbf{test(Count)}} \\ \hline
\endhead
%
\multicolumn{1}{|l|}{\cellcolor[HTML]{EFEFEF}test(Total)} &
\multicolumn{1}{|c|}{\cellcolor[HTML]{EFEFEF}test} &
\multicolumn{1}{c|}{\cellcolor[HTML]{EFEFEF}test} &
{\cellcolor[HTML]{EFEFEF}test} &
\multicolumn{1}{|c|}{\cellcolor[HTML]{EFEFEF}test} &
\multicolumn{1}{c|}{\cellcolor[HTML]{EFEFEF}test} &
{\cellcolor[HTML]{EFEFEF}test} \\ \hline
\multicolumn{1}{|l|}{test}
& \multicolumn{1}{c|}{00:04} & \multicolumn{1}{c|}{C} & \multicolumn{1}{c|}{D}
& \multicolumn{1}{c|}{1} & \multicolumn{1}{c|}{F} & \multicolumn{1}{c|}{G} \\ \hline
\multicolumn{1}{|l|}{test}
& \multicolumn{1}{c|}{07:21} & \multicolumn{1}{c|}{C} & \multicolumn{1}{c|}{D}
& \multicolumn{1}{c|}{47} & \multicolumn{1}{c|}{F} & \multicolumn{1}{c|}{G} \\ \hline
\multicolumn{1}{|l|}{test}
& \multicolumn{1}{c|}{00:18} & \multicolumn{1}{c|}{C} & \multicolumn{1}{c|}{D}
& \multicolumn{1}{c|}{3} & \multicolumn{1}{c|}{F} & \multicolumn{1}{c|}{G} \\ \hline
\multicolumn{1}{|l|}{test}
& \multicolumn{1}{c|}{00:18} & \multicolumn{1}{c|}{C} & \multicolumn{1}{c|}{D}
& \multicolumn{1}{c|}{3} & \multicolumn{1}{c|}{F} & \multicolumn{1}{c|}{G} \\ \hline
\multicolumn{1}{|l|}{test}
& \multicolumn{1}{c|}{00:40} & \multicolumn{1}{c|}{C} & \multicolumn{1}{c|}{D}
& \multicolumn{1}{c|}{9} & \multicolumn{1}{c|}{F} & \multicolumn{1}{c|}{G} \\ \hline
\multicolumn{1}{|l|}{test}
& \multicolumn{1}{c|}{01:20} & \multicolumn{1}{c|}{C} & \multicolumn{1}{c|}{D}
& \multicolumn{1}{c|}{24} & \multicolumn{1}{c|}{F} & \multicolumn{1}{c|}{G} \\ \hline
\multicolumn{1}{|l|}{test}
& \multicolumn{1}{c|}{00:50} & \multicolumn{1}{c|}{C} & \multicolumn{1}{c|}{D}
& \multicolumn{1}{c|}{7} & \multicolumn{1}{c|}{F} & \multicolumn{1}{c|}{G} \\ \hline
\multicolumn{1}{|l|}{test}
& \multicolumn{1}{c|}{00:16} & \multicolumn{1}{c|}{C} & \multicolumn{1}{c|}{D}
& \multicolumn{1}{c|}{2} & \multicolumn{1}{c|}{F} & \multicolumn{1}{c|}{G} \\ \hline
\multicolumn{1}{|l|}{test}
& \multicolumn{1}{c|}{00:28} & \multicolumn{1}{c|}{C} & \multicolumn{1}{c|}{D}
& \multicolumn{1}{c|}{7} & \multicolumn{1}{c|}{F} & \multicolumn{1}{c|}{G} \\ \hline
\multicolumn{1}{|l|}{test}
& \multicolumn{1}{c|}{00:24} & \multicolumn{1}{c|}{NOB} & \multicolumn{1}{c|}{NOB}
& \multicolumn{1}{c|}{1} & \multicolumn{1}{c|}{NOB} & \multicolumn{1}{c|}{NOB} \\ \hline
\multicolumn{1}{|l|}{test}
& \multicolumn{1}{c|}{01:53} & \multicolumn{1}{c|}{C} & \multicolumn{1}{c|}{D}
& \multicolumn{1}{c|}{33} & \multicolumn{1}{c|}{F} & \multicolumn{1}{c|}{G} \\ \hline
\multicolumn{1}{|l|}{test}
& \multicolumn{1}{c|}{04:32} & \multicolumn{1}{c|}{C} & \multicolumn{1}{c|}{D}
& \multicolumn{1}{c|}{63} & \multicolumn{1}{c|}{F} & \multicolumn{1}{c|}{G} \\ \hline
\multicolumn{1}{|l|}{test}
& \multicolumn{1}{c|}{00:05} & \multicolumn{1}{c|}{C} & \multicolumn{1}{c|}{D}
& \multicolumn{1}{c|}{3} & \multicolumn{1}{c|}{F} & \multicolumn{1}{c|}{G} \\ \hline
\multicolumn{1}{|l|}{test}
& \multicolumn{1}{c|}{13:21} & \multicolumn{1}{c|}{C} & \multicolumn{1}{c|}{D}
& \multicolumn{1}{c|}{128} & \multicolumn{1}{c|}{F} & \multicolumn{1}{c|}{G} \\ \hline
\multicolumn{1}{|l|}{test}
& \multicolumn{1}{c|}{00:16} & \multicolumn{1}{c|}{C} & \multicolumn{1}{c|}{D}
& \multicolumn{1}{c|}{4} & \multicolumn{1}{c|}{F} & \multicolumn{1}{c|}{G} \\ \hline
\multicolumn{1}{|l|}{test}
& \multicolumn{1}{c|}{00:25} & \multicolumn{1}{c|}{C} & \multicolumn{1}{c|}{D}
& \multicolumn{1}{c|}{6} & \multicolumn{1}{c|}{F} & \multicolumn{1}{c|}{G} \\ \hline
\multicolumn{1}{|l|}{test}
& \multicolumn{1}{c|}{10:19} & \multicolumn{1}{c|}{C} & \multicolumn{1}{c|}{D}
& \multicolumn{1}{c|}{41} & \multicolumn{1}{c|}{F} & \multicolumn{1}{c|}{G} \\ \hline
\multicolumn{1}{|l|}{test}
& \multicolumn{1}{c|}{00:26} & \multicolumn{1}{c|}{C} & \multicolumn{1}{c|}{D}
& \multicolumn{1}{c|}{10} & \multicolumn{1}{c|}{F} & \multicolumn{1}{c|}{G} \\ \hline
\multicolumn{1}{|l|}{test}
& \multicolumn{1}{c|}{00:07} & \multicolumn{1}{c|}{C} & \multicolumn{1}{c|}{D}
& \multicolumn{1}{c|}{3} & \multicolumn{1}{c|}{F} & \multicolumn{1}{c|}{G} \\ \hline
\multicolumn{1}{|l|}{test}
& \multicolumn{1}{c|}{00:12} & \multicolumn{1}{c|}{C} & \multicolumn{1}{c|}{D}
& \multicolumn{1}{c|}{3} & \multicolumn{1}{c|}{F} & \multicolumn{1}{c|}{G} \\ \hline
\multicolumn{1}{|l|}{test}
& \multicolumn{1}{c|}{00:14} & \multicolumn{1}{c|}{C} & \multicolumn{1}{c|}{D}
& \multicolumn{1}{c|}{2} & \multicolumn{1}{c|}{F} & \multicolumn{1}{c|}{G} \\ \hline
\multicolumn{1}{|l|}{test}
& \multicolumn{1}{c|}{NOB} & \multicolumn{1}{c|}{C} & \multicolumn{1}{c|}{D}
& \multicolumn{1}{c|}{NOB} & \multicolumn{1}{c|}{F} & \multicolumn{1}{c|}{G} \\ \hline
\multicolumn{1}{|l|}{\textbf{Grand Total}} & \multicolumn{1}{c|}{43:49} & \multicolumn{1}{c|}{43:25} & \multicolumn{1}{c|}{48:50}
& \multicolumn{1}{c|}{401} & \multicolumn{1}{c|}{397} & \multicolumn{1}{c|}{51} \\\hline
\end{longtable}
`
I tried to duplicate the following part of the code
`
\multicolumn{1}{|l|}{\cellcolor[HTML]{EFEFEF}test(Total)} &
\multicolumn{1}{|c|}{\cellcolor[HTML]{EFEFEF}test} &
\multicolumn{1}{c|}{\cellcolor[HTML]{EFEFEF}test} &
{\cellcolor[HTML]{EFEFEF}test} &
\multicolumn{1}{|c|}{\cellcolor[HTML]{EFEFEF}test} &
\multicolumn{1}{c|}{\cellcolor[HTML]{EFEFEF}test} &
{\cellcolor[HTML]{EFEFEF}test} \\ \hline
`
You can add the row you want to appear at the top of every page to your longtable header.
Wrapping each and every cell into a \multicolumn is neither necessary nor useful for anything.
\documentclass[a4paper]{report}
\usepackage[a4paper, total={6in, 9in}]{geometry}
\usepackage{graphicx} % Required for box manipulation
\usepackage{helvet}
\usepackage{subfig}
\usepackage[utf8]{inputenc}
%\usepackage{natbib}
\usepackage[square, comma, sort&compress]{natbib}
\usepackage[USenglish]{babel}
\usepackage[useregional]{datetime2}
\usepackage{pgfgantt}
\usepackage{listings}
\usepackage{wrapfig}
\usepackage{setspace}
\usepackage{parskip} % Used to create spaces between paragraphs
\usepackage{dirtytalk} % quotes by talk
%\usepackage[hidelinks]{hyperref}
\usepackage[colorlinks=true,citecolor=red]{hyperref}
\usepackage[acronym, toc]{glossaries} % Used to add a wordlist/glossaries
\usepackage{mathtools}
\usepackage{amsfonts}
\usepackage{color, colortbl}
\usepackage{booktabs}
\usepackage{float}
\usepackage{csquotes}
%zelf toegevoegd
\usepackage[most]{tcolorbox}
\usepackage{multirow} %table
\usepackage{xcolor,colortbl}
\usepackage{pdflscape}
\usepackage{pifont} %%%bullet points
\usepackage{longtable}
\usepackage{graphicx}
%\usepackage{geometry} %table margin
\begin{document}
\begin{longtable}{|l|ccc|ccc|}
\caption{test}
\label{test}\\
\cline{2-7}
\multicolumn{1}{l|}{} & \multicolumn{3}{c|}{\cellcolor{lightgray}\textbf{Duration test}} & \multicolumn{3}{c|}{\cellcolor{lightgray}\textbf{test(Count)}} \\ \hline
\rowcolor[HTML]{EFEFEF}test(Total) & test & test & test & test & test & test\\\hline
\endfirsthead
\multicolumn{7}{c}{{\bfseries Table \thetable\ continued from previous page}} \\
\cline{2-7}
\multicolumn{1}{l|}{} & \multicolumn{3}{c|}{\cellcolor{lightgray}\textbf{Duration test)}} & \multicolumn{3}{c|}{\cellcolor{lightgray}\textbf{test(Count)}} \\ \hline
\rowcolor[HTML]{EFEFEF}test(Total) & test & test & test & test & test & test\\\hline
\endhead
%
test & 00:04 & C & D & 1 & F & G \\ \hline
test & 07:21 & C & D & 47 & F & G \\ \hline
test & 00:18 & C & D & 3 & F & G \\ \hline
test & 00:18 & C & D & 3 & F & G \\ \hline
test & 00:40 & C & D & 9 & F & G \\ \hline
test & 01:20 & C & D & 24 & F & G \\ \hline
test & 00:50 & C & D & 7 & F & G \\ \hline
test & 00:16 & C & D & 2 & F & G \\ \hline
test & 00:28 & C & D & 7 & F & G \\ \hline
test & 00:24 & NOB & NOB & 1 & NOB & NOB \\ \hline
test & 01:53 & C & D & 33 & F & G \\ \hline
test & 04:32 & C & D & 63 & F & G \\ \hline
test & 00:05 & C & D & 3 & F & G \\ \hline
test & 13:21 & C & D & 128 & F & G \\ \hline
test & 00:16 & C & D & 4 & F & G \\ \hline
test & 00:25 & C & D & 6 & F & G \\ \hline
test & 10:19 & C & D & 41 & F & G \\ \hline
test & 00:26 & C & D & 10 & F & G \\ \hline
test & 00:07 & C & D & 3 & F & G \\ \hline
test & 00:12 & C & D & 3 & F & G \\ \hline
test & 00:14 & C & D & 2 & F & G \\ \hline
test & NOB & C & D & NOB & F & G \\ \hline
test & 00:04 & C & D & 1 & F & G \\ \hline
test & 07:21 & C & D & 47 & F & G \\ \hline
test & 00:18 & C & D & 3 & F & G \\ \hline
test & 00:18 & C & D & 3 & F & G \\ \hline
test & 00:40 & C & D & 9 & F & G \\ \hline
test & 01:20 & C & D & 24 & F & G \\ \hline
test & 00:50 & C & D & 7 & F & G \\ \hline
test & 00:16 & C & D & 2 & F & G \\ \hline
test & 00:28 & C & D & 7 & F & G \\ \hline
test & 00:24 & NOB & NOB & 1 & NOB & NOB \\ \hline
test & 01:53 & C & D & 33 & F & G \\ \hline
test & 04:32 & C & D & 63 & F & G \\ \hline
test & 00:05 & C & D & 3 & F & G \\ \hline
test & 13:21 & C & D & 128 & F & G \\ \hline
test & 00:16 & C & D & 4 & F & G \\ \hline
test & 00:25 & C & D & 6 & F & G \\ \hline
test & 10:19 & C & D & 41 & F & G \\ \hline
test & 00:26 & C & D & 10 & F & G \\ \hline
test & 00:07 & C & D & 3 & F & G \\ \hline
test & 00:12 & C & D & 3 & F & G \\ \hline
test & 00:14 & C & D & 2 & F & G \\ \hline
test & NOB & C & D & NOB & F & G \\ \hline
test & 00:04 & C & D & 1 & F & G \\ \hline
test & 07:21 & C & D & 47 & F & G \\ \hline
test & 00:18 & C & D & 3 & F & G \\ \hline
test & 00:18 & C & D & 3 & F & G \\ \hline
test & 00:40 & C & D & 9 & F & G \\ \hline
test & 01:20 & C & D & 24 & F & G \\ \hline
test & 00:50 & C & D & 7 & F & G \\ \hline
test & 00:16 & C & D & 2 & F & G \\ \hline
test & 00:28 & C & D & 7 & F & G \\ \hline
test & 00:24 & NOB & NOB & 1 & NOB & NOB \\ \hline
test & 01:53 & C & D & 33 & F & G \\ \hline
test & 04:32 & C & D & 63 & F & G \\ \hline
test & 00:05 & C & D & 3 & F & G \\ \hline
test & 13:21 & C & D & 128 & F & G \\ \hline
test & 00:16 & C & D & 4 & F & G \\ \hline
test & 00:25 & C & D & 6 & F & G \\ \hline
test & 10:19 & C & D & 41 & F & G \\ \hline
test & 00:26 & C & D & 10 & F & G \\ \hline
test & 00:07 & C & D & 3 & F & G \\ \hline
test & 00:12 & C & D & 3 & F & G \\ \hline
test & 00:14 & C & D & 2 & F & G \\ \hline
test & NOB & C & D & NOB & F & G \\ \hline
\textbf{Grand Total} & 43:49 & 43:25 & 48:50
& 401 & 397 & 51 \\\hline
\end{longtable}
\end{document}

Triangle with Latex

How can I reproduce this table with Latex?
Some help would be appreciated.
My suggestion for this table:
\documentclass{article}
\begin{document}
Text.
\begin{table}[h]
\sffamily
\begin{tabular}{r|*{12}{r}}
& \multicolumn{12}{l}{Development year}\\
U/W year & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 \\
\hline
2001 & n & n & n & n & n & n & n & n & n & n & n & n\\
2002 & n & n & n & n & n & n & n & n & n & n & n & \\
2003 & n & n & n & n & n & n & n & n & n & n & & \\
2004 & n & n & n & n & n & n & n & n & n & & & \\
2005 & n & n & n & n & n & n & n & n & & & & \\
2006 & n & n & n & n & n & n & n & & & & & \\
2007 & n & n & n & n & n & n & & & & & & \\
2008 & n & n & n & n & n & & & & & & & \\
2009 & n & n & n & n & & & & & & & & \\
2010 & n & n & n & & & & & & & & & \\
2011 & n & n & & & & & & & & & & \\
2012 & n & & & & & & & & & & & \\
& & & & & & & & & & & & \\
\hline
link ratios: & a & b & c & d & e & f & g & h & i & j & k & %l
\end{tabular}
\end{table}
Text.
\end{document}
Within the "fine tuning", I noticed that cells in lines 2 and 3-16 are both right-aligned, but with different right margins: write a comment if you wish to reproduce that effect precisely.

LaTeX - two columns within the same listing?

I'm trying to achieve the following but with no problems in spacing.
The image is what I'm trying to achieve but without the spacing problems :
At the moment it's just a normal listing with tabbing.
I want to avoid tabbing by introducing two columns. Is that possible?
Current code:
\begin{lstlisting}[caption=Elements of time in the background knowledge, label=btime]
year(Y):- hour(H):-
Y in 2000..2011. H in 0..23.
month(M):- minute(M):-
M in 1..12. M in 0..59.
day_of_month(D):- seconds(S):-
D in 1..31. minute(S).
date([D, M, Y]):- time([H,M]):-
year(Y), hour(H),
month(M), minute(M).
day_of_month(D).
\end{lstlisting}
Something like this (result looks like THIS)?
\begin{tabular}{p{7cm}p{7cm}}
year(Y):- & hour(H):- \\
\hspace{10mm}Y in 2000..2011. & \hspace{10mm} H in 0..23. \\
& \\
month(M):- & minute(M):- \\
\hspace{10mm} M in 1..12. & \hspace{10mm} M in 0..59. \\
& \\
day\_of\_month(D):- & seconds(S):- \\
\hspace{10mm} D in 1..31. & \hspace{10mm} minute(S). \\
& \\
date([D, M, Y]):- & \hspace{10mm} time([H,M]):- \\
\hspace{10mm} year(Y), & \hspace{15mm} hour(H), \\
\hspace{10mm} month(M), & \hspace{10mm} minute(M). \\
\hspace{10mm} day\_of\_month(D). & \\
\end{tabular}
Tweak the values p{Xcm} to get the column distance you want
Tweak the values \hspace{Xmm} to get the indentation you want
An alternative would be to use \quad or \qquad, though that might not be enough for you

LaTex: how does the include-command work?

I supposed the include-command copy-pastes code in the compilation, it is wrong because the code stopped working. Please, see the middle part in the code. I only copy-pasted the code to the file and added the include-command.
$ cat results/frames.tex
10.31 & 8.50 & 7.40 \\
10.34 & 8.53 & 7.81 \\
8.22 & 8.62 & 7.78 \\
10.16 & 8.53 & 7.44 \\
10.41 & 8.38 & 7.63 \\
10.38 & 8.57 & 8.03 \\
10.13 & 8.66 & 7.41 \\
8.50 & 8.60 & 7.15 \\
10.41 & 8.63 & 7.21 \\
8.53 & 8.53 & 7.12 \\
Latex code, see the middle part
\begin{table}
\begin{tabular}{ | l | m | r |}
\hline
$t$ / s & $d_{1}$ / s & $d_{2}$ / s \\
$\Delta h = 0,01 s$ & $\Delta d = 0,01 s$ & $\Delta d = 0,01 s$ \\
\hline
% I JUST COPIED THE CODE from here to the file, included.
% It stopped working, why?
\include{results/frames.tex}
\hline
$\pi (\frac{d_{1}}{2} - \frac{d_{2}}{2})$ & $2 \pi R h$ & $2 \pi r h$ \\
\hline
\end{tabular}
\end{table}
Use \input instead of \include, that will work.
\include additionally performs a \clearpage command which will not work in the context of a table.
Try with \input, \include is old and very limited..

Resources