Thanks to this amazing community here I have gotten pretty far with my thesis document, but this problem has had me scratching my head for a while. I have only been able to use \resizebox for this table. That however messes up with the footnote I need to use and renders it quite strange.
I have tried \longtable package, but when I tried that with this table, I got an undefined control sequense pointing me to \end{longtable}. There might be some package michmach causing that.
I have also tried to use tabularray package, with siunitx, but siunitx throws up an error telling me it can't read the numbers in my table. That is probably due to some PATH issues. I haven't been able to pinpoint that out. I did delete all TexLive and LaTeX packages I could find on my system and reinstalled all of the packages, but it did not work. Due to time shortage, I am not going to follow up more on this error.
I do not want to render this table in landscape. Now few of these headings are quite long, but due to nature of my native language and what information I am trying to come across, it is not possible to shorten them, so wraping is essential.
Here are all the packages and the table in entirety:
\documentclass[a4paper,12pt,twoside,BCOR=10mm]{scrbook}
\usepackage[utf8]{inputenc}
\usepackage[icelandic]{babel}
% \usepackage{t1enc}
\usepackage[T1]{fontenc}
\usepackage[dvipsnames]{xcolor}
\usepackage{graphicx,booktabs}
\usepackage[intoc]{nomencl}
\usepackage{enumerate,color}
\usepackage{url}
\usepackage{appendix}
\usepackage{float}
\usepackage{eso-pic}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{longtable}
\usepackage{acronym}
\usepackage{nicematrix}
\usepackage{makecell}
% \usepackage{tablefootnote}
\usepackage{threeparttable}
\usepackage{placeins}
% \usepackage{tabularx,booktabs}
\usepackage{longtable}
\usepackage{multirow}
\usepackage{adjustbox}
\usepackage{subcaption}
%\usepackage{subfig}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\usepgfplotslibrary{external}
% Packages used for title page layout
\usepackage{tikz}
\usetikzlibrary{positioning}
\usepackage[pdfborder={0 0 0}]{hyperref}
\usepackage{scrextend}
\usepackage{lmodern} % Use Latin Modern (instead of the default Computer Modern that is rendered using a bitmap font).
\usepackage{fixcmex} % To fix that Latin Modern large symbol math fonts has by default only one size: https://tex.stackexchange.com/a/621536
% Times new roman font instead of the standard LaTeX fonts: has not been test -- try this on your own risk
%\usepackage{mathptmx}
\usepackage[backend=biber, style=authoryear]{biblatex} % BibLaTeX used for references.
\usepackage{csquotes} % BibLaTex wants to have context sensitive quotes
\begin{document}
\begin{table}
\centering
{\small\renewcommand{\arraystretch}{.8}
\caption{Spá um raforkunotkun, forgangsorka og skerðanleg orka. Almenn notkun að meðtöldum dreifitöpum og núverandi og samþykktir nýir stórnotendur. \label{table:Orkuspá}}
\scriptsize\tabcolsep=2pt
\resizebox{!}{.31\paperheight}{
\begin{threeparttable}
\begin{NiceTabular}{lcccccccccc}
\hline
\Block{2-1}{Ár} & \Block{1-2}{Úttekt frá dreifikerfinu\\ forgangs- og skerðanleg\\ orka með dreifitöpum} & & \Block{1-2}{Úttekt frá\\ flutningskerfinu} & & \Block{1-2}{Flutningstöp} & & \Block{1-2}{Úttekt frá \\ vinnslufyrirtækjum} & & \Block{1-2}{Samtals} \\
& Orka GWh & Afl MW & Orka GWh & Afl MW & Orka GWh & Afl MW & Orka GWh & Afl MW & Orka GWh & Afl MW \\
\hline
2015 \tnote{*} & 3.604,74 & 618,46 & 14.356,34 & 1.685,89 & 369,56 & 57,11 & 468,32 & 75,40 & 18.798,96 & 2.383,25 \\
2016 \tnote{*} & 3.383,99 & 590,10 & 14.334,19 & 1.695,96 & 360,42 & 57,05 & 470,86 & 71,46 & 18.549,46 & 2.378,51 \\
2017 \tnote{*} & 3.519,13 & 608,86 & 14.869,95 & 1.750,87 & 373,07 & 61,49 & 476,38 & 84,74 & 19.238,53 & 2.443,61 \\
2018 \tnote{*} & 3.682,07 & 623,26 & 15.259,88 & 1.838,28 & 398,09 & 70,47 & 489,75 & 70,71 & 19.829,79 & 2.519,53 \\
2019 \tnote{*} & 3.506,86 & 596,63 & 15.145,31 & 1.829,48 & 365,82 & 63,40 & 476,84 & 85,11 & 19.494,83 & 2.495,07 \\
2020 \tnote{*} & 3.473,77 & 596,83 & 14.830,70 & 1.790,95 & 353,09 & 60,54 & 469,74 & 72,27 & 19.127,30 & 2.408,28 \\
2021 & 3.688,10 & 630,47 & 15.539,59 & 1.865,64 & 397,70 & 67,72 & 479,82 & 73,82 & 20.105,21 & 2.584,89 \\
2022 & 3.785,98 & 647,81 & 16.099,28 & 1.875,76 & 416,40 & 69,68 & 490,14 & 75,41 & 20.791,80 & 2.615,29 \\
2023 & 3.901,70 & 668,25 & 16.260,20 & 1.893,98 & 427,58 & 70,34 & 500,66 & 77,02 & 21.090,13 & 2.655,40 \\
2024 & 3.991,75 & 684,32 & 16.325,85 & 1.899,97 & 436,37 & 70,59 & 511,28 & 78,66 & 21.265,25 & 2.678,87 \\
2025 & 4.062,50 & 697,11 & 16.343,42 & 1.903,47 & 443,82 & 70,62 & 521,72 & 80,27 & 21.371,46 & 2.696,43 \\
2026 & 4.122,77 & 708,12 & 16.343,42 & 1.903,47 & 450,61 & 70,54 & 526,76 & 81,04 & 21.443,55 & 2.707,91 \\
2027 & 4.211,88 & 724,11 & 16.343,42 & 1.903,47 & 458,05 & 70,57 & 531,45 & 81,76 & 21.544,79 & 2.724,32 \\
2028 & 4.296,04 & 739,29 & 16.342,96 & 1.903,47 & 465,42 & 70,58 & 536,08 & 82,47 & 21.640,51 & 2.739,90 \\
2029 & 4.411,85 & 759,94 & 16.342,96 & 1.903,47 & 473,55 & 70,71 & 540,85 & 83,21 & 21.769,21 & 2.760,98 \\
2030 & 4.532,38 & 781,44 & 16.342,96 & 1.903,47 & 481,86 & 70,86 & 545,67 & 83,95 & 21.902,87 & 2.782,93 \\
2031 & 4.620,14 & 795,89 & 16.342,96 & 1.903,47 & 481,69 & 70,84 & 550,32 & 84,66 & 21.995,11 & 2.797,77 \\
2032 & 4.717,78 & 812,01 & 16.342,96 & 1.903,47 & 481,73 & 70,84 & 555,02 & 85,39 & 22.097,48 & 2.814,28 \\
2033 & 4.812,21 & 827,55 & 16.342,96 & 1.903,47 & 481,67 & 70,83 & 559,78 & 86,12 & 22.196,62 & 2.830,22 \\
2034 & 4.902,86 & 842,42 & 16.342,96 & 1.903,47 & 481,51 & 70,81 & 564,68 & 86,87 & 22.292,01 & 2.845,50 \\
2035 & 4.989,20 & 856,51 & 16.342,96 & 1.903,47 & 481,24 & 70,77 & 569,72 & 87,65 & 22.383,12 & 2.860,04 \\
2036 & 5.072,75 & 870,11 & 16.342,96 & 1.903,47 & 480,89 & 70,72 & 574,87 & 88,44 & 22.471,48 & 2.874,09 \\
2037 & 5.152,14 & 882,97 & 16.342,96 & 1.903,47 & 480,43 & 70,65 & 580,05 & 89,24 & 22.555,59 & 2.887,41 \\
2038 & 5.228,32 & 895,26 & 16.342,96 & 1.903,47 & 479,89 & 70,57 & 585,32 & 90,05 & 22.636,49 & 2.900,17 \\
2039 & 5.302,08 & 907,11 & 16.342,96 & 1.903,47 & 479,29 & 70,48 & 590,68 & 90,87 & 22.715,00 & 2.912,50 \\
2040 & 5.405,41 & 924,00 & 16.342,96 & 1.903,47 & 479,30 & 70,49 & 596,13 & 91,71 & 22.823,81 & 2.929,88 \\
2041 & 5.478,79 & 935,75 & 16.342,96 & 1.903,47 & 478,65 & 70,39 & 601,62 & 92,56 & 22.902,03 & 2.942,12 \\
2042 & 5.552,10 & 947,46 & 16.342,96 & 1.903,47 & 477,99 & 70,29 & 607,11 & 93,40 & 22.980,15 & 2.954,33 \\
2043 & 5.626,68 & 959,37 & 16.342,96 & 1.903,47 & 477,33 & 70,20 & 612,60 & 94,25 & 23.059,57 & 2.966,73 \\
2044 & 5.703,24 & 971,59 & 16.342,96 & 1.903,47 & 476,71 & 70,10 & 618,20 & 95,11 & 23.141,10 & 2.979,47 \\
2045 & 5.782,58 & 984,27 & 16.342,96 & 1.903,47 & 476,12 & 70,02 & 623,90 & 95,98 & 23.225,56 & 2.992,67 \\
2046 & 5.864,53 & 997,37 & 16.342,96 & 1.903,47 & 475,58 & 69,94 & 629,65 & 96,87 & 23.312,72 & 3.006,30 \\
2047 & 5.948,06 & 1.010,72 & 16.342,96 & 1.903,47 & 475,05 & 69,86 & 635,38 & 97,75 & 23.401,45 & 3.020,16 \\
2048 & 6.033,38 & 1.024,34 & 16.342,96 & 1.903,47 & 474,54 & 69,79 & 641,24 & 98,65 & 23.492,13 & 3.034,33 \\
2049 & 6.119,59 & 1.038,10 & 16.342,96 & 1.903,47 & 474,03 & 69,71 & 647,11 & 99,56 & 23.583,69 & 3.048,62 \\
2050 & 6.207,13 & 1.052,06 & 16.342,96 & 1.903,47 & 473,53 & 69,64 & 653,00 & 100,46 & 23.676,62 & 3.063,11 \\
2051 & 6.298,36 & 1.067,52 & 16.342,96 & 1.903,47 & 475,50 & 69,93 & 658,16 & 101,26 & 23.774,98 & 3.079,33 \\
2052 & 6.389,36 & 1.082,94 & 16.342,96 & 1.903,47 & 477,46 & 70,22 & 663,38 & 102,06 & 23.873,16 & 3.095,51 \\
2053 & 6.479,88 & 1.098,29 & 16.342,96 & 1.903,47 & 479,42 & 70,50 & 668,64 & 102,87 & 23.970,91 & 3.111,63 \\
2054 & 6.569,42 & 1.113,46 & 16.342,96 & 1.903,47 & 481,35 & 70,79 & 673,96 & 103,69 & 24.067,70 & 3.127,58 \\
2055 & 6.657,82 & 1.128,44 & 16.342,96 & 1.903,47 & 483,27 & 71,07 & 679,34 & 104,51 & 24.163,39 & 3.143,35 \\
2056 & 6.744,86 & 1.143,20 & 16.342,96 & 1.903,47 & 485,15 & 71,35 & 684,76 & 105,35 & 24.257,74 & 3.158,90 \\
2057 & 6.830,19 & 1.157,66 & 16.342,96 & 1.903,47 & 487,01 & 71,62 & 690,25 & 106,19 & 24.350,41 & 3.174,16 \\
2058 & 6.913,30 & 1.171,75 & 16.342,96 & 1.903,47 & 488,82 & 71,88 & 695,78 & 107,04 & 24.440,86 & 3.189,06 \\
2059 & 6.993,67 & 1.185,37 & 16.342,96 & 1.903,47 & 490,57 & 72,14 & 701,37 & 107,90 & 24.528,57 & 3.203,51 \\
2060 & 7.071,89 & 1.198,63 & 16.342,96 & 1.903,47 & 492,28 & 72,39 & 707,02 & 108,77 & 24.614,16 & 3.217,60 \\
\textbf{2061} & \textbf{7.172,96} & \textbf{1.214,87} & \textbf{16.398,49} & \textbf{1.907,18} & \textbf{496,07} & \textbf{71,07} & \textbf{712,49} & \textbf{109,61} & \textbf{24.780,01} & \textbf{3.236,67} \\
\textbf{2062} & \textbf{7.258,87} & \textbf{1.229,10} & \textbf{16.402,60} & \textbf{1.907,46} & \textbf{497,27} & \textbf{71,09} & \textbf{717,97} & \textbf{110,46} & \textbf{24.876,71} & \textbf{3.251,74} \\
\textbf{2063} & \textbf{7.344,78} & \textbf{1.243,34} & \textbf{16.406,71} & \textbf{1.907,73} & \textbf{498,47} & \textbf{71,12} & \textbf{723,45} & \textbf{111,30} & \textbf{24.973,41} & \textbf{3.266,82} \\
\textbf{2064} & \textbf{7.430,69} & \textbf{1.257,57} & \textbf{16.410,81} & \textbf{1.908,01} & \textbf{499,67} & \textbf{71,14} & \textbf{728,94} & \textbf{112,14} & \textbf{25.070,11} & \textbf{3.281,89} \\
\textbf{2065} & \textbf{7.516,60} & \textbf{1.271,80} & \textbf{16.414,92} & \textbf{1.908,29} & \textbf{500,87} & \textbf{71,17} & \textbf{734,42} & \textbf{112,99} & \textbf{25.166,80} & \textbf{3.296,96} \\
\textbf{2066} & \textbf{7.602,51} & \textbf{1.286,04} & \textbf{16.419,02} & \textbf{1.908,56} & \textbf{502,07} & \textbf{71,20} & \textbf{739,90} & \textbf{113,83} & \textbf{25.263,50} & \textbf{3.312,04} \\
\textbf{2067} & \textbf{7.688,41} & \textbf{1.300,27} & \textbf{16.423,13} & \textbf{1.908,84} & \textbf{503,27} & \textbf{71,22} & \textbf{745,39} & \textbf{114,67} & \textbf{25.360,20} & \textbf{3.327,11} \\
\textbf{2068} & \textbf{7.772,08} & \textbf{1.313,81} & \textbf{16.395,02} & \textbf{1.907,70} & \textbf{502,13} & \textbf{71,14} & \textbf{750,25} & \textbf{115,42} & \textbf{25.456,90} & \textbf{3.342,18} \\
\textbf{2069} & \textbf{7.855,96} & \textbf{1.327,38} & \textbf{16.387,86} & \textbf{1.906,81} & \textbf{501,46} & \textbf{71,14} & \textbf{755,25} & \textbf{116,19} & \textbf{25.553,60} & \textbf{3.357,25} \\
\textbf{2070} & \textbf{7.940,94} & \textbf{1.341,16} & \textbf{16.386,68} & \textbf{1.906,59} & \textbf{500,99} & \textbf{71,16} & \textbf{760,41} & \textbf{116,99} & \textbf{25.650,29} & \textbf{3.372,33} \\
\textbf{2071} & \textbf{8.026,03} & \textbf{1.354,96} & \textbf{16.388,08} & \textbf{1.906,60} & \textbf{500,68} & \textbf{71,19} & \textbf{765,78} & \textbf{117,81} & \textbf{25.746,99} & \textbf{3.387,40} \\
\hline
\end{NiceTabular}
\begin{tablenotes}
\item[*]Rauntölur
\end{tablenotes}
\end{threeparttable}}}
\end{table}
\end{document}
I am not very experienced with LaTeX, and I don't know which packages play badly or well with other. If it is possible to cram this table in one page without rezisebox, I am all ears, but if not, then this is only in appendix.
Edit: 20023-04-26(YYYY-MM-DD)
Tried to put up tabularx environment, got an error missing number: treated as zero at \begin{tabularx}. Uncomment \usepackage{tabularx} from code above. Here is how I call the funciton:
\begin{table}
\centering
\caption{one more time}
\begin{threeparttable}
\begin{tabularx}{*{11}{X}}
\toprule
THE TABLE FROM ABOVE
\bottomrule
\end{tabularx}
\begin{tablenotes}
\item[*]Rauntölur
\end{tablenotes}
\end{threeparttable}
\end{table}

lmodernfont package and then to clobber it with themathptmxfont package. – Mico Apr 26 '23 at 12:26mathptmx– Ólafur Víðir Guðbjargarson Apr 26 '23 at 12:44(MWh)etc). That saves a lot of space. Next use\footnotesizeinstead of\small. Then it actually fits within the line width. I don't thinkNiceTabularandthreeparttableplays that well with each other especially with that like with the\Block's are being used. – daleif Apr 26 '23 at 13:54MWhandMWare on a special line. I'll try changing to\footnotesize. What would you use instead ofNiceTabular? Regulartabularortabularx? – Ólafur Víðir Guðbjargarson Apr 26 '23 at 13:58tabularx– daleif Apr 26 '23 at 14:00NiceTabulartotabularandtabularx. Both provide me with an error on\end{threeparttable}. Fortabularit isundefined control sequense, and fortabularxI getMissing number, treated as zero. – Ólafur Víðir Guðbjargarson Apr 26 '23 at 14:05tabularxenvironment correctly. Please show the code you use to invoke a tabularx env. – Mico Apr 26 '23 at 14:14\begin{tabularx}{XXXXXXXXXXX}(11 X because I have 11 columns) andend{tabularx? I am fairly new and I am not sure what you mean by "Invoketabularxenvironment"... Sorry, I just noticed that I forgot to uncomment\usepackage{tabularx}, my mistake.... had not effect, I literally just swappedNiceTabularout fortabularx– Ólafur Víðir Guðbjargarson Apr 26 '23 at 14:17tabularraypackage. Its talltable and longtable options are designed for these tables. Plus it usesbooktabsandsiunitxas libraries. – alchemist Apr 26 '23 at 14:50tabularrayandsiunitxdoesn't work for me, probably due to some $PATH problem, as mentioned in my post. – Ólafur Víðir Guðbjargarson Apr 26 '23 at 14:53siunitxgive you? I doubt it is $PATH$ related, but this is just a guess ... – alchemist Apr 26 '23 at 15:15siunitxis something along not being able to read the first number in the table. I have no idea how to troubleshoot that. My TexLive-latexextra has alsmot all packages available, as seen here, I am using GNOME-Latex – Ólafur Víðir Guðbjargarson Apr 26 '23 at 18:08