1

I have this table that I want to fit over multiple pages, therefore longtable. Now it won't fit to the page width.

The table is pretty big... The second and third column are coordinates and can't be shortened unfortunately...

\hline
\multicolumn{1}{|l|}{} &
  \multicolumn{2}{c|}{Design} &
  \multicolumn{2}{c|}{Kontrol} &
  \multicolumn{2}{c|}{Differens} &
  \multicolumn{1}{l|}{Gns.snit} &
  \multicolumn{1}{l|}{Sigma} &
  \multicolumn{1}{l|}{d\_max} \\ \hline
\endfirsthead
%
\endhead
%
\multicolumn{1}{|l|}{Pkt.} &
  \multicolumn{1}{l|}{Easting} &
  \multicolumn{1}{l|}{Northing} &
  \multicolumn{1}{l|}{Easting} &
  \multicolumn{1}{l|}{Northing} &
  \multicolumn{1}{l|}{Easting} &
  \multicolumn{1}{l|}{Northing} &
  {\color[HTML]{202122} μ {[}m{]}} &
  {\color[HTML]{202122} σ {[}m{]}} &
  {[}m{]} \\ \hline
1  & \multicolumn{1}{r|}{729598,741} & 6171261,02  & \multicolumn{1}{r|}{729598,743} & 6171261,029 & \multicolumn{1}{r|}{-0,002} & -0,009 &  &  &  \\ \cline{1-7}
2  & \multicolumn{1}{r|}{729598,897} & 6171260,664 & \multicolumn{1}{r|}{729598,909} & 6171260,669 & \multicolumn{1}{r|}{-0,012} & -0,005 &  &  &  \\ \cline{1-7}
3  & \multicolumn{1}{r|}{729598,973} & 6171260,489 & \multicolumn{1}{r|}{729598,987} & 6171260,491 & \multicolumn{1}{r|}{-0,014} & -0,002 &  &  &  \\ \cline{1-7}
4  & \multicolumn{1}{r|}{729591,938} & 6171258,298 & \multicolumn{1}{r|}{729591,935} & 6171258,284 & \multicolumn{1}{r|}{0,003}  & 0,014  &  &  &  \\ \cline{1-7}
5  & \multicolumn{1}{r|}{729592,087} & 6171257,93  & \multicolumn{1}{r|}{729592,087} & 6171257,926 & \multicolumn{1}{r|}{0,000}  & 0,004  &  &  &  \\ \cline{1-7}
6  & \multicolumn{1}{r|}{729592,181} & 6171257,727 & \multicolumn{1}{r|}{729592,184} & 6171257,726 & \multicolumn{1}{r|}{-0,003} & 0,001  &  &  &  \\ \cline{1-7}
7  & \multicolumn{1}{r|}{729586,791} & 6171256,205 & \multicolumn{1}{r|}{729586,792} & 6171256,222 & \multicolumn{1}{r|}{-0,001} & -0,017 &  &  &  \\ \cline{1-7}
8  & \multicolumn{1}{r|}{729586,931} & 6171255,84  & \multicolumn{1}{r|}{729586,935} & 6171255,830 & \multicolumn{1}{r|}{-0,004} & 0,01   &  &  &  \\ \cline{1-7}
9  & \multicolumn{1}{r|}{729587,022} & 6171255,644 & \multicolumn{1}{r|}{729587,020} & 6171255,648 & \multicolumn{1}{r|}{0,002}  & -0,004 &  &  &  \\ \cline{1-7}
10 & \multicolumn{1}{r|}{729583,342} & 6171254,816 & \multicolumn{1}{r|}{729583,347} & 6171254,816 & \multicolumn{1}{r|}{-0,005} & 0,000  &  &  &  \\ \cline{1-7}
11 & \multicolumn{1}{r|}{729583,489} & 6171254,435 & \multicolumn{1}{r|}{729583,499} & 6171254,431 & \multicolumn{1}{r|}{-0,010} & 0,004  &  &  &  \\ \cline{1-7}
12 & \multicolumn{1}{r|}{729583,576} & 6171254,245 & \multicolumn{1}{r|}{729583,561} & 6171254,249 & \multicolumn{1}{r|}{0,015}  & -0,004 &  &  &  \\ \cline{1-7}
13 & \multicolumn{1}{r|}{729579,337} & 6171253,176 & \multicolumn{1}{r|}{729579,336} & 6171253,173 & \multicolumn{1}{r|}{0,001}  & 0,003  &  &  &  \\ \cline{1-7}
14 & \multicolumn{1}{r|}{729579,438} & 6171252,864 & \multicolumn{1}{r|}{729579,449} & 6171252,857 & \multicolumn{1}{r|}{-0,011} & 0,007  &  &  &  \\ \cline{1-7}
15 & \multicolumn{1}{r|}{729579,562} & 6171252,6   & \multicolumn{1}{r|}{729579,553} & 6171252,603 & \multicolumn{1}{r|}{0,009}  & -0,003 &  &  &  \\ \cline{1-7}
16 & \multicolumn{1}{r|}{729575,731} & 6171251,687 & \multicolumn{1}{r|}{729575,729} & 6171251,683 & \multicolumn{1}{r|}{0,002}  & 0,004  &  &  &  \\ \cline{1-7}
17 & \multicolumn{1}{r|}{729575,814} & 6171251,419 & \multicolumn{1}{r|}{729575,834} & 6171251,411 & \multicolumn{1}{r|}{-0,020} & 0,008  &  &  &  \\ \cline{1-7}
18 & \multicolumn{1}{r|}{729575,958} & 6171251,135 & \multicolumn{1}{r|}{729575,952} & 6171251,134 & \multicolumn{1}{r|}{0,006}  & 0,001  &  &  &  \\ \cline{1-7}
19 & \multicolumn{1}{r|}{729568,597} & 6171248,783 & \multicolumn{1}{r|}{729568,580} & 6171248,789 & \multicolumn{1}{r|}{0,017}  & -0,006 &  &  &  \\ \cline{1-7}
20 & \multicolumn{1}{r|}{729568,73}  & 6171248,412 & \multicolumn{1}{r|}{729568,726} & 6171248,417 & \multicolumn{1}{r|}{0,004}  & -0,005 &  &  &  \\ \cline{1-7}
21 & \multicolumn{1}{r|}{729568,795} & 6171248,231 & \multicolumn{1}{r|}{729568,803} & 6171248,223 & \multicolumn{1}{r|}{-0,008} & 0,008  &  &  &  \\ \cline{1-7}
22 & \multicolumn{1}{r|}{729562,201} & 6171246,188 & \multicolumn{1}{r|}{729562,204} & 6171246,191 & \multicolumn{1}{r|}{-0,003} & -0,003 &  &  &  \\ \cline{1-7}
23 & \multicolumn{1}{r|}{729562,341} & 6171245,81  & \multicolumn{1}{r|}{729562,334} & 6171245,818 & \multicolumn{1}{r|}{0,007}  & -0,008 &  &  &  \\ \cline{1-7}
24 & \multicolumn{1}{r|}{729562,41}  & 6171245,628 & \multicolumn{1}{r|}{729562,408} & 6171245,631 & \multicolumn{1}{r|}{0,002}  & -0,003 &  &  &  \\ \cline{1-7}
25 & \multicolumn{1}{r|}{729555,891} & 6171243,616 & \multicolumn{1}{r|}{729555,895} & 6171243,617 & \multicolumn{1}{r|}{-0,004} & -0,001 &  &  &  \\ \cline{1-7}
26 & \multicolumn{1}{r|}{729556,006} & 6171243,377 & \multicolumn{1}{r|}{729556,003} & 6171243,377 & \multicolumn{1}{r|}{0,003}  & 0,000  &  &  &  \\ \cline{1-7}
27 & \multicolumn{1}{r|}{729556,112} & 6171243,069 & \multicolumn{1}{r|}{729556,105} & 6171243,079 & \multicolumn{1}{r|}{0,007}  & -0,010 &  &  &  \\ \cline{1-7}
28 & \multicolumn{1}{r|}{729550,186} & 6171241,296 & \multicolumn{1}{r|}{729550,182} & 6171241,300 & \multicolumn{1}{r|}{0,004}  & -0,004 &  &  &  \\ \cline{1-7}
29 & \multicolumn{1}{r|}{729550,305} & 6171241,07  & \multicolumn{1}{r|}{729550,310} & 6171241,064 & \multicolumn{1}{r|}{-0,005} & 0,006  &  &  &  \\ \cline{1-7}
30 & \multicolumn{1}{r|}{729550,411} & 6171240,743 & \multicolumn{1}{r|}{729550,415} & 6171240,747 & \multicolumn{1}{r|}{-0,004} & -0,004 &  &  &  \\ \cline{1-7}
31 & \multicolumn{1}{r|}{729538,652} & 6171236,606 & \multicolumn{1}{r|}{729538,662} & 6171236,611 & \multicolumn{1}{r|}{-0,010} & -0,005 &  &  &  \\ \cline{1-7}
32 & \multicolumn{1}{r|}{729538,803} & 6171236,231 & \multicolumn{1}{r|}{729538,816} & 6171236,234 & \multicolumn{1}{r|}{-0,013} & -0,003 &  &  &  \\ \cline{1-7}
33 & \multicolumn{1}{r|}{729538,879} & 6171236,044 & \multicolumn{1}{r|}{729538,889} & 6171236,045 & \multicolumn{1}{r|}{-0,010} & -0,001 &  &  &  \\ \cline{1-7}
34 & \multicolumn{1}{r|}{729533,279} & 6171234,425 & \multicolumn{1}{r|}{729533,290} & 6171234,444 & \multicolumn{1}{r|}{-0,011} & -0,019 &  &  &  \\ \cline{1-7}
35 & \multicolumn{1}{r|}{729533,426} & 6171234,044 & \multicolumn{1}{r|}{729533,440} & 6171234,043 & \multicolumn{1}{r|}{-0,014} & 0,001  &  &  &  \\ \cline{1-7}
36 & \multicolumn{1}{r|}{729533,505} & 6171233,85  & \multicolumn{1}{r|}{729533,499} & 6171233,856 & \multicolumn{1}{r|}{0,006}  & -0,006 &  &  &  \\ \cline{1-7}
37 & \multicolumn{1}{r|}{729528,457} & 6171232,45  & \multicolumn{1}{r|}{729528,465} & 6171232,451 & \multicolumn{1}{r|}{-0,008} & -0,001 &  &  &  \\ \cline{1-7}
38 & \multicolumn{1}{r|}{729528,608} & 6171232,081 & \multicolumn{1}{r|}{729528,612} & 6171232,077 & \multicolumn{1}{r|}{-0,004} & 0,004  &  &  &  \\ \cline{1-7}
39 & \multicolumn{1}{r|}{729528,686} & 6171231,903 & \multicolumn{1}{r|}{729528,680} & 6171231,902 & \multicolumn{1}{r|}{0,006}  & 0,001  &  &  &  \\ \cline{1-7}
40 & \multicolumn{1}{r|}{729521,837} & 6171229,747 & \multicolumn{1}{r|}{729521,841} & 6171229,753 & \multicolumn{1}{r|}{-0,004} & -0,006 &  &  &  \\ \cline{1-7}
41 & \multicolumn{1}{r|}{729521,985} & 6171229,364 & \multicolumn{1}{r|}{729521,982} & 6171229,360 & \multicolumn{1}{r|}{0,003}  & 0,004  &  &  &  \\ \cline{1-7}
42 & \multicolumn{1}{r|}{729522,063} & 6171229,185 & \multicolumn{1}{r|}{729522,063} & 6171229,184 & \multicolumn{1}{r|}{0,000}  & 0,001  &  &  &  \\ \cline{1-7}
43 & \multicolumn{1}{r|}{729517,553} & 6171227,989 & \multicolumn{1}{r|}{729517,560} & 6171227,989 & \multicolumn{1}{r|}{-0,007} & 0,000  &  &  &  \\ \cline{1-7}
44 & \multicolumn{1}{r|}{729517,709} & 6171227,629 & \multicolumn{1}{r|}{729517,708} & 6171227,634 & \multicolumn{1}{r|}{0,001}  & -0,005 &  &  &  \\ \cline{1-7}
45 & \multicolumn{1}{r|}{729517,78}  & 6171227,442 & \multicolumn{1}{r|}{729517,774} & 6171227,442 & \multicolumn{1}{r|}{0,006}  & 0,000  &  &  &  \\ \cline{1-7}
46 & \multicolumn{1}{r|}{729513,038} & 6171226,164 & \multicolumn{1}{r|}{729513,042} & 6171226,161 & \multicolumn{1}{r|}{-0,004} & 0,003  &  &  &  \\ \cline{1-7}
47 & \multicolumn{1}{r|}{729513,198} & 6171225,787 & \multicolumn{1}{r|}{729513,201} & 6171225,791 & \multicolumn{1}{r|}{-0,003} & -0,004 &  &  &  \\ \cline{1-7}
48 &
  \multicolumn{1}{r|}{729513,265} &
  6171225,606 &
  \multicolumn{1}{r|}{729513,284} &
  6171225,557 &
  \multicolumn{1}{r|}{-0,019} &
  \cellcolor[HTML]{FF0000}0,049 &
   &
   &
   \\ \cline{1-7}
49 & \multicolumn{1}{r|}{729507,361} & 6171223,854 & \multicolumn{1}{r|}{729507,357} & 6171223,858 & \multicolumn{1}{r|}{0,004}  & -0,004 &  &  &  \\ \cline{1-7}
50 & \multicolumn{1}{r|}{729507,515} & 6171223,487 & \multicolumn{1}{r|}{729507,510} & 6171223,491 & \multicolumn{1}{r|}{0,005}  & -0,004 &  &  &  \\ \cline{1-7}
51 & \multicolumn{1}{r|}{729507,589} & 6171223,298 & \multicolumn{1}{r|}{729507,591} & 6171223,302 & \multicolumn{1}{r|}{-0,002} & -0,004 &  &  &  \\ \cline{1-7}
52 & \multicolumn{1}{r|}{729502,897} & 6171222,041 & \multicolumn{1}{r|}{729502,891} & 6171222,026 & \multicolumn{1}{r|}{0,006}  & 0,015  &  &  &  \\ \cline{1-7}
53 & \multicolumn{1}{r|}{729503,061} & 6171221,668 & \multicolumn{1}{r|}{729503,062} & 6171221,659 & \multicolumn{1}{r|}{-0,001} & 0,009  &  &  &  \\ \cline{1-7}
54 & \multicolumn{1}{r|}{729503,12}  & 6171221,49  & \multicolumn{1}{r|}{729503,117} & 6171221,496 & \multicolumn{1}{r|}{0,003}  & -0,006 &  &  &  \\ \cline{1-7}
55 & \multicolumn{1}{r|}{729498,329} & 6171220,185 & \multicolumn{1}{r|}{729498,328} & 6171220,177 & \multicolumn{1}{r|}{0,001}  & 0,008  &  &  &  \\ \cline{1-7}
56 & \multicolumn{1}{r|}{729498,478} & 6171219,801 & \multicolumn{1}{r|}{729498,488} & 6171219,807 & \multicolumn{1}{r|}{-0,010} & -0,006 &  &  &  \\ \cline{1-7}
57 & \multicolumn{1}{r|}{729498,557} & 6171219,624 & \multicolumn{1}{r|}{729498,552} & 6171219,632 & \multicolumn{1}{r|}{0,005}  & -0,008 &  &  &  \\ \cline{1-7}
58 & \multicolumn{1}{r|}{729584,389} & 6171255,864 & \multicolumn{1}{r|}{729584,388} & 6171255,868 & \multicolumn{1}{r|}{0,001}  & -0,004 &  &  &  \\ \cline{1-7}
59 & \multicolumn{1}{r|}{729517,339} & 6171228,518 & \multicolumn{1}{r|}{729517,338} & 6171228,516 & \multicolumn{1}{r|}{0,001}  & 0,002  &  &  &  \\ \cline{1-7}
60 & \multicolumn{1}{r|}{729543,328} & 6171239,092 & \multicolumn{1}{r|}{729543,333} & 6171239,102 & \multicolumn{1}{r|}{-0,005} & -0,010 &  &  &  \\ \cline{1-7}
61 &
  \multicolumn{1}{r|}{729558,679} &
  6171245,372 &
  \multicolumn{1}{r|}{729558,693} &
  6171245,371 &
  \multicolumn{1}{r|}{-0,014} &
  0,001 &
  \multirow{-61}{*}{-0,001} &
  \multirow{-61}{*}{0,008} &
  \multirow{-61}{*}{0,025} \\ \hline
\caption{Beregning af afsætning - undergruppe 3a}
\label{tab:afs_beregn_3a}\\
\end{longtable}```
1
  • 1
    Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
    – Community Bot
    Commented May 21, 2023 at 15:09

3 Answers 3

2

The material in columns 8 thru 10 appears to be identical for all rows. Hence, why not take it out of the table and decrease the column count from 10 to 7?

If that's not permissible, I suggest you typeset the longtable in landscape mode, as is done in the following code and associated screenshot.

I would also align the numbers on their decimal markers. And, to improve the table's overall readability, I suggest you get rid of all \cline directives and, instead, insert a bit of whitespace after every 5th row or so to create a better sense of visual grouping.

Last but not least, do please get rid of the pointless \multicolumn{1}{r|} wrappers.

enter image description here

\documentclass{article}  % or some other suitable document class
\usepackage[T1]{fontenc}
\usepackage[danish]{babel} 
\usepackage{longtable}
\usepackage{xcolor,colortbl}

% new:
\usepackage{pdflscape} % for 'landscape' environment
\usepackage{siunitx} % for 'S' col. type
\sisetup{output-decimal-marker={,}, group-digits=false}
\usepackage{booktabs} % for well-spaced horizontal rules

\begin{document}
\begin{landscape}
\begin{longtable}{@{}
        S[table-format= 2.0] 
   *{2}{S[table-format= 6.3]S[table-format= 7.3]}
   *{3}{S[table-format=-1.3]}
   *{2}{S[table-format= 1.3]}
   @{}}

%% headers and footers 
\toprule
  {Pkt.} &
  \multicolumn{2}{c}{Design} &
  \multicolumn{2}{c}{Kontrol} &
  \multicolumn{2}{c}{Differens} &
  {Gns.snit $\mu$} & 
  {Sigma $\sigma$} & 
  {d\_max} \\ 
  \cmidrule(lr){2-3} \cmidrule(lr){4-5} \cmidrule(lr){6-7}
  & {Easting} & {Northing} 
  & {Easting} & {Northing} 
  & {Easting} & {Northing} &
  {\color[HTML]{202122} [m]} &
  {\color[HTML]{202122} [m]} &
  {[m]} \\ 
  \midrule
\endhead

\bottomrule
\addlinespace
\caption{Beregning af afsætning - undergruppe 3a}
\label{tab:afs_beregn_3a}
\endlastfoot

%% body of longtable
1  & 729598,741 & 6171261,02  & 729598,743 & 6171261,029 & -0,002 & -0,009 & -0,001 & 0,008 & 0,025 \\ 
2  & 729598,897 & 6171260,664 & 729598,909 & 6171260,669 & -0,012 & -0,005 \\ 
3  & 729598,973 & 6171260,489 & 729598,987 & 6171260,491 & -0,014 & -0,002 \\ 
4  & 729591,938 & 6171258,298 & 729591,935 & 6171258,284 & 0,003  & 0,014  \\ 
5  & 729592,087 & 6171257,93  & 729592,087 & 6171257,926 & 0,000  & 0,004  \\ \addlinespace
6  & 729592,181 & 6171257,727 & 729592,184 & 6171257,726 & -0,003 & 0,001  \\ 
7  & 729586,791 & 6171256,205 & 729586,792 & 6171256,222 & -0,001 & -0,017 \\ 
8  & 729586,931 & 6171255,84  & 729586,935 & 6171255,830 & -0,004 & 0,01   \\ 
9  & 729587,022 & 6171255,644 & 729587,020 & 6171255,648 & 0,002  & -0,004 \\ 
10 & 729583,342 & 6171254,816 & 729583,347 & 6171254,816 & -0,005 & 0,000  \\ \addlinespace
11 & 729583,489 & 6171254,435 & 729583,499 & 6171254,431 & -0,010 & 0,004  \\ 
12 & 729583,576 & 6171254,245 & 729583,561 & 6171254,249 & 0,015  & -0,004 \\ 
13 & 729579,337 & 6171253,176 & 729579,336 & 6171253,173 & 0,001  & 0,003  \\ 
14 & 729579,438 & 6171252,864 & 729579,449 & 6171252,857 & -0,011 & 0,007  \\ 
15 & 729579,562 & 6171252,6   & 729579,553 & 6171252,603 & 0,009  & -0,003 \\ \addlinespace
16 & 729575,731 & 6171251,687 & 729575,729 & 6171251,683 & 0,002  & 0,004  \\ 
17 & 729575,814 & 6171251,419 & 729575,834 & 6171251,411 & -0,020 & 0,008  \\ 
18 & 729575,958 & 6171251,135 & 729575,952 & 6171251,134 & 0,006  & 0,001  \\ 
19 & 729568,597 & 6171248,783 & 729568,580 & 6171248,789 & 0,017  & -0,006 \\ 
20 & 729568,73  & 6171248,412 & 729568,726 & 6171248,417 & 0,004  & -0,005 \\ \addlinespace
21 & 729568,795 & 6171248,231 & 729568,803 & 6171248,223 & -0,008 & 0,008  \\ 
22 & 729562,201 & 6171246,188 & 729562,204 & 6171246,191 & -0,003 & -0,003 \\ 
23 & 729562,341 & 6171245,81  & 729562,334 & 6171245,818 & 0,007  & -0,008 \\ 
24 & 729562,41  & 6171245,628 & 729562,408 & 6171245,631 & 0,002  & -0,003 \\ 
25 & 729555,891 & 6171243,616 & 729555,895 & 6171243,617 & -0,004 & -0,001 \\ \addlinespace
26 & 729556,006 & 6171243,377 & 729556,003 & 6171243,377 & 0,003  & 0,000  \\ 
27 & 729556,112 & 6171243,069 & 729556,105 & 6171243,079 & 0,007  & -0,010 \\ 
28 & 729550,186 & 6171241,296 & 729550,182 & 6171241,300 & 0,004  & -0,004 \\ 
29 & 729550,305 & 6171241,07  & 729550,310 & 6171241,064 & -0,005 & 0,006  \\ 
30 & 729550,411 & 6171240,743 & 729550,415 & 6171240,747 & -0,004 & -0,004 \\ \addlinespace
31 & 729538,652 & 6171236,606 & 729538,662 & 6171236,611 & -0,010 & -0,005 \\ 
32 & 729538,803 & 6171236,231 & 729538,816 & 6171236,234 & -0,013 & -0,003 \\ 
33 & 729538,879 & 6171236,044 & 729538,889 & 6171236,045 & -0,010 & -0,001 \\ 
34 & 729533,279 & 6171234,425 & 729533,290 & 6171234,444 & -0,011 & -0,019 \\ 
35 & 729533,426 & 6171234,044 & 729533,440 & 6171234,043 & -0,014 & 0,001  \\ \addlinespace
36 & 729533,505 & 6171233,85  & 729533,499 & 6171233,856 & 0,006  & -0,006 \\ 
37 & 729528,457 & 6171232,45  & 729528,465 & 6171232,451 & -0,008 & -0,001 \\ 
38 & 729528,608 & 6171232,081 & 729528,612 & 6171232,077 & -0,004 & 0,004  \\ 
39 & 729528,686 & 6171231,903 & 729528,680 & 6171231,902 & 0,006  & 0,001  \\ 
40 & 729521,837 & 6171229,747 & 729521,841 & 6171229,753 & -0,004 & -0,006 \\ \addlinespace
41 & 729521,985 & 6171229,364 & 729521,982 & 6171229,360 & 0,003  & 0,004  \\ 
42 & 729522,063 & 6171229,185 & 729522,063 & 6171229,184 & 0,000  & 0,001  \\ 
43 & 729517,553 & 6171227,989 & 729517,560 & 6171227,989 & -0,007 & 0,000  \\ 
44 & 729517,709 & 6171227,629 & 729517,708 & 6171227,634 & 0,001  & -0,005 \\ 
45 & 729517,78  & 6171227,442 & 729517,774 & 6171227,442 & 0,006  & 0,000  \\ \addlinespace
46 & 729513,038 & 6171226,164 & 729513,042 & 6171226,161 & -0,004 & 0,003  \\ 
47 & 729513,198 & 6171225,787 & 729513,201 & 6171225,791 & -0,003 & -0,004 \\ 
48 & 729513,265 & 6171225,606 & 729513,284 & 6171225,557 & -0,019 & \cellcolor[HTML]{FF0000} 0,049 \\ 
49 & 729507,361 & 6171223,854 & 729507,357 & 6171223,858 & 0,004  & -0,004 \\ 
50 & 729507,515 & 6171223,487 & 729507,510 & 6171223,491 & 0,005  & -0,004 \\ \addlinespace
51 & 729507,589 & 6171223,298 & 729507,591 & 6171223,302 & -0,002 & -0,004 \\ 
52 & 729502,897 & 6171222,041 & 729502,891 & 6171222,026 & 0,006  & 0,015  \\ 
53 & 729503,061 & 6171221,668 & 729503,062 & 6171221,659 & -0,001 & 0,009  \\ 
54 & 729503,12  & 6171221,49  & 729503,117 & 6171221,496 & 0,003  & -0,006 \\ 
55 & 729498,329 & 6171220,185 & 729498,328 & 6171220,177 & 0,001  & 0,008  \\ \addlinespace
56 & 729498,478 & 6171219,801 & 729498,488 & 6171219,807 & -0,010 & -0,006 \\ 
57 & 729498,557 & 6171219,624 & 729498,552 & 6171219,632 & 0,005  & -0,008 \\ 
58 & 729584,389 & 6171255,864 & 729584,388 & 6171255,868 & 0,001  & -0,004 \\ 
59 & 729517,339 & 6171228,518 & 729517,338 & 6171228,516 & 0,001  & 0,002  \\ 
60 & 729543,328 & 6171239,092 & 729543,333 & 6171239,102 & -0,005 & -0,010 \\ \addlinespace
61 & 729558,679 & 6171245,372 & 729558,693 & 6171245,371 & -0,014 &  0,001 \\

\end{longtable}
\end{landscape}

\end{document}
2
  • 1
    The third and fifth columns have 7 integer digits, not six. This is more visible if you enable grouping of digits. See edit in my answer.
    – Zarko
    Commented Oct 19, 2023 at 22:43
  • @Zarko - Thanks for noticing this issue. I've updated the code and screenshot.
    – Mico
    Commented Oct 19, 2023 at 23:05
2

A variation of nice @Mico answer (+1) with use of tabularray. package. Table width is equal to \linewidth (= \textheight):

Edit (1):
Now is corrected specification for the third and fifth columns. From 6 integer digits in orginal answer are corrected to 7 as numbers in these columns have.

Edit (2):
Added is code for use of colors based on HTML color model. Additionally is a wee bit changed table specification, which make row spacing more correct:

\documentclass{article}  % or some other suitable document class
\usepackage[T1]{fontenc}
\usepackage[danish]{babel}
%\usepackage{longtable}
\usepackage{pdflscape} % for 'landscape' environment

\usepackage{xcolor,
            %colortbl   % not needed
            }
% new:
\usepackage{tabularray}
    \UseTblrLibrary{booktabs, siunitx} 

    \NewTblrTheme{fancy}{
    \SetTblrStyle{head}{font=\small}
    \SetTblrStyle{foot}{font=\footnotesize}
    \SetTblrStyle{caption-tag}{font=\bfseries}
                        }
\makeatletter   % new, added
      \ExplSyntaxOn
    \NewChildSelector{eachfive}
      {
        \int_step_inline:nnnn {1}{5}{\l_tblr_childs_total_tl}
          { \clist_put_right:Nn \l_tblr_childs_clist {##1} }
      }
% HTML coloring in table <--- new, added
\pretocmd{\@declaredcolor}{\my@hack@color{#1}}{}{}
\def\my@hack@color#1{\@ifundefined{\@backslashchar color@#1}{\MyDefineColor{#1}}{\relax}}
\cs_generate_variant:Nn \seq_set_split:Nnn { Nnx }
\NewDocumentCommand \MyDefineColor { m } {
  \seq_set_split:Nnx \l_tmpa_seq {|} {#1}
  \exp_args:Nnxx \definecolor{#1} { \seq_item:Nn \l_tmpa_seq {1} } { \seq_item:Nn \l_tmpa_seq {2} }
}
    \ExplSyntaxOff
\makeatother   % new, added
    \NewTableCommand\SCC[1]{\SetCell{bg=#1}}    % for coloring of a (lonely) cell
    
    \sisetup{output-decimal-marker={,}, 
             table-auto-round,   % changed from
group-digits=false
}

\begin{document}
\begin{landscape}
\begin{longtblr}[
  theme = fancy,
caption = {Beregning af afsætning - undergruppe 3a},
  label = {tab:afs_beregn_3a}
                ]{colspec = {@{} Q[r, si={table-format=2.0}]
                            *{2}{X[c, si={table-format=6.3}]  % <--- 
                                 X[c, si={table-format=7.3}]} % <---
                            *{3}{Q[c, si={table-format=-1.3}]}
                            *{2}{Q[c, si={table-format= 1.3}]}
                             @{}},
                 cell{1}{even[2-6]} = {c=2}{},
                 cell{2}{8-10} = {fg={HTML|202122}}, 
  % chaanged from {fg=blue!60!black},
                 row{1,2} = {guard},
                 row{3-Y} = {rowsep=0pt},
                 row{3} = {abovesep=2pt},   row{Z} = {belowsep=2pt},
                 row{eachfive} = {belowsep=1ex},
                 rowhead  = 2
                }
%% headers
    \toprule
Pkt.    & Design            &
        & Kontrol           &
        & Differens         &
        & Gns.snit $\mu$    &
  {Sigma $\sigma$} &
  {d\_max} \\
  \cmidrule[lr]{2-3} \cmidrule[lr]{4-5} \cmidrule[lr]{6-7}
    & Easting               & Northing
    & Easting               & Northing
    & Easting               & Northing 
                                & [m]
                                    & [m]
                                        & [m] \\
  \midrule
%% body of longtblr
1  & 729598,741 & 6171261,02  & 729598,743 & 6171261,029 & -0,002 & -0,009 
                                                            & -0,001 & 0,008 & 0,025 \\
2  & 729598,897 & 6171260,664 & 729598,909 & 6171260,669 & -0,012 & -0,005 \\
3  & 729598,973 & 6171260,489 & 729598,987 & 6171260,491 & -0,014 & -0,002 \\
4  & 729591,938 & 6171258,298 & 729591,935 & 6171258,284 & 0,003  & 0,014  \\
5  & 729592,087 & 6171257,93  & 729592,087 & 6171257,926 & 0,000  & 0,004  \\ 
6  & 729592,181 & 6171257,727 & 729592,184 & 6171257,726 & -0,003 & 0,001  \\
7  & 729586,791 & 6171256,205 & 729586,792 & 6171256,222 & -0,001 & -0,017 \\
8  & 729586,931 & 6171255,84  & 729586,935 & 6171255,830 & -0,004 & 0,01   \\
9  & 729587,022 & 6171255,644 & 729587,020 & 6171255,648 & 0,002  & -0,004 \\
10 & 729583,342 & 6171254,816 & 729583,347 & 6171254,816 & -0,005 & 0,000  \\ 
11 & 729583,489 & 6171254,435 & 729583,499 & 6171254,431 & -0,010 & 0,004  \\
12 & 729583,576 & 6171254,245 & 729583,561 & 6171254,249 & 0,015  & -0,004 \\
13 & 729579,337 & 6171253,176 & 729579,336 & 6171253,173 & 0,001  & 0,003  \\
14 & 729579,438 & 6171252,864 & 729579,449 & 6171252,857 & -0,011 & 0,007  \\
15 & 729579,562 & 6171252,6   & 729579,553 & 6171252,603 & 0,009  & -0,003 \\ 
16 & 729575,731 & 6171251,687 & 729575,729 & 6171251,683 & 0,002  & 0,004  \\
17 & 729575,814 & 6171251,419 & 729575,834 & 6171251,411 & -0,020 & 0,008  \\
18 & 729575,958 & 6171251,135 & 729575,952 & 6171251,134 & 0,006  & 0,001  \\
19 & 729568,597 & 6171248,783 & 729568,580 & 6171248,789 & 0,017  & -0,006 \\
20 & 729568,73  & 6171248,412 & 729568,726 & 6171248,417 & 0,004  & -0,005 \\ 
21 & 729568,795 & 6171248,231 & 729568,803 & 6171248,223 & -0,008 & 0,008  \\
22 & 729562,201 & 6171246,188 & 729562,204 & 6171246,191 & -0,003 & -0,003 \\
23 & 729562,341 & 6171245,81  & 729562,334 & 6171245,818 & 0,007  & -0,008 \\
24 & 729562,41  & 6171245,628 & 729562,408 & 6171245,631 & 0,002  & -0,003 \\
25 & 729555,891 & 6171243,616 & 729555,895 & 6171243,617 & -0,004 & -0,001 \\ 
26 & 729556,006 & 6171243,377 & 729556,003 & 6171243,377 & 0,003  & 0,000  \\
27 & 729556,112 & 6171243,069 & 729556,105 & 6171243,079 & 0,007  & -0,010 \\
28 & 729550,186 & 6171241,296 & 729550,182 & 6171241,300 & 0,004  & -0,004 \\
29 & 729550,305 & 6171241,07  & 729550,310 & 6171241,064 & -0,005 & 0,006  \\
30 & 729550,411 & 6171240,743 & 729550,415 & 6171240,747 & -0,004 & -0,004 \\ 
31 & 729538,652 & 6171236,606 & 729538,662 & 6171236,611 & -0,010 & -0,005 \\
32 & 729538,803 & 6171236,231 & 729538,816 & 6171236,234 & -0,013 & -0,003 \\
33 & 729538,879 & 6171236,044 & 729538,889 & 6171236,045 & -0,010 & -0,001 \\
34 & 729533,279 & 6171234,425 & 729533,290 & 6171234,444 & -0,011 & -0,019 \\
35 & 729533,426 & 6171234,044 & 729533,440 & 6171234,043 & -0,014 & 0,001  \\ 
36 & 729533,505 & 6171233,85  & 729533,499 & 6171233,856 & 0,006  & -0,006 \\
37 & 729528,457 & 6171232,45  & 729528,465 & 6171232,451 & -0,008 & -0,001 \\
38 & 729528,608 & 6171232,081 & 729528,612 & 6171232,077 & -0,004 & 0,004  \\
39 & 729528,686 & 6171231,903 & 729528,680 & 6171231,902 & 0,006  & 0,001  \\
40 & 729521,837 & 6171229,747 & 729521,841 & 6171229,753 & -0,004 & -0,006 \\ 
41 & 729521,985 & 6171229,364 & 729521,982 & 6171229,360 & 0,003  & 0,004  \\
42 & 729522,063 & 6171229,185 & 729522,063 & 6171229,184 & 0,000  & 0,001  \\
43 & 729517,553 & 6171227,989 & 729517,560 & 6171227,989 & -0,007 & 0,000  \\
44 & 729517,709 & 6171227,629 & 729517,708 & 6171227,634 & 0,001  & -0,005 \\
45 & 729517,78  & 6171227,442 & 729517,774 & 6171227,442 & 0,006  & 0,000  \\ 
46 & 729513,038 & 6171226,164 & 729513,042 & 6171226,161 & -0,004 & 0,003  \\
47 & 729513,198 & 6171225,787 & 729513,201 & 6171225,791 & -0,003 & -0,004 \\
48 & 729513,265 & 6171225,606 & 729513,284 & 6171225,557 & -0,019 & \SCC{HTML|FF0000} 0,049 \\
49 & 729507,361 & 6171223,854 & 729507,357 & 6171223,858 & 0,004  & -0,004 \\
50 & 729507,515 & 6171223,487 & 729507,510 & 6171223,491 & 0,005  & -0,004 \\ 
51 & 729507,589 & 6171223,298 & 729507,591 & 6171223,302 & -0,002 & -0,004 \\
52 & 729502,897 & 6171222,041 & 729502,891 & 6171222,026 & 0,006  & 0,015  \\
53 & 729503,061 & 6171221,668 & 729503,062 & 6171221,659 & -0,001 & 0,009  \\
54 & 729503,12  & 6171221,49  & 729503,117 & 6171221,496 & 0,003  & -0,006 \\
55 & 729498,329 & 6171220,185 & 729498,328 & 6171220,177 & 0,001  & 0,008  \\ 
56 & 729498,478 & 6171219,801 & 729498,488 & 6171219,807 & -0,010 & -0,006 \\
57 & 729498,557 & 6171219,624 & 729498,552 & 6171219,632 & 0,005  & -0,008 \\
58 & 729584,389 & 6171255,864 & 729584,388 & 6171255,868 & 0,001  & -0,004 \\
59 & 729517,339 & 6171228,518 & 729517,338 & 6171228,516 & 0,001  & 0,002  \\
60 & 729543,328 & 6171239,092 & 729543,333 & 6171239,102 & -0,005 & -0,010 \\ 
61 & 729558,679 & 6171245,372 & 729558,693 & 6171245,371 & -0,014 &  0,001 \\
    \bottomrule
\end{longtblr}
    \end{landscape}
\end{document}

enter image description here enter image description here enter image description here

3
  • A detail, si={table-format= 6.3} causes Overfull hbox
    – pascal974
    Commented Oct 19, 2023 at 7:53
  • Thank you for introducing me to \NewChildSelector, I tested with 6 title lines with { \int_step_inline:nnnn {6}{5}{\l_tblr_childs_total_tl}` , if I understood correctly shouldn't it be {\int_step_inline:nnnn {2}{5} and row{3-Y} = {rowsep=0pt}
    – pascal974
    Commented Oct 19, 2023 at 11:17
  • 1
    @pascal974, I discover what was wrong in original answer. The third and fifth columns has 7 intrige digits, not 6 as I was blindly copy from Mico answer. Now these specification are corrected.
    – Zarko
    Commented Oct 19, 2023 at 22:33
0

Reduce the width of your table; Im a GOM so I would have thought that that might have occured to you. From the code you show you can eliminate the initial "72" from the first and third columns --- an exercise for you the reader.

You must log in to answer this question.

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