I suggest using the url
package, which provides the \url
command specifically designed for typesetting URLs. I've also utilized \parbox
to create a paragraph, allowing me to write the URL on multiple lines. Here is your modified code:
\documentclass[a4paper]{article}
\usepackage[margin=1in]{geometry}
\usepackage[ngerman]{babel}
\usepackage[table]{xcolor}
\usepackage[version=3]{mhchem}
\usepackage{url} % <--- I have added this package here
\begin{document}
\begin{table}[h]
\caption{Düngemittel Reinnährstoffabsatz von 1995/96 bis 2013/14 (Menge in t)}
\resizebox{\textwidth}{!}{\begin{tabular}{|p{4cm}|p{4cm}p{4cm}p{4cm}|}
\noalign{\global\arrayrulewidth=0,25mm}
\hline \rowcolor{brown!80}
Jahr & Stickstoff (N) & Phosphor (\ce{P2O5}) & Kalium (\ce{K2O}) \\
\hline \rowcolor{brown!20}
2013/14 & 111.615 & 32.731 & 32.559 \\
2011/12 & 97.721 & 26.198 & 32.478 \\
\rowcolor{brown!20}
2009/10 & 90.639 & 22.121 & 23.356 \\
2007/08 & 134.382 & 44.704 & 49.787 \\
\rowcolor{brown!20}
2005/06 & 103.692 & 34.979 & 40.738 \\
2003/04 & 100.789 & 39.357 & 49.532 \\
\rowcolor{brown!20}
2001/02 & 127.585 & 47.138 & 50.099 \\
1999/00 & 121.644 & 48.548 & 55.241 \\
\rowcolor{brown!20}
1997/98 & 127.537 & 57.264 & 61.537 \\
1995/96 & 125.309 & 52.272 & 59.755 \\
\hline
% I have modified the line below ⬇
\multicolumn{4}{l}{\parbox{\linewidth}{Quelle: \url{https://www.ama.at/getattachment/f3f479f8-6bc9-42e3-be83-d8fd4112a937/281_Dungemittel_Reinnahrstoffabsatz-ab-1995.pdf} (besucht am 20-01-2024)}}
\end{tabular}}
\end{table}
\end{document}
However, I do think that this is poorly typeset. I would suggest using the tabularray
package, which offers many options such as the ability to set specific colors for ranges of cells, columns, or rows (even the option to specify for even and odd). tabularray
also supports notes below tables. Here is the code for creating the table with the tabularray
package:
\documentclass[a4paper]{article}
\usepackage[margin=1in]{geometry}
\usepackage[ngerman]{babel}
\usepackage{booktabs}
\PassOptionsToPackage{table}{xcolor}
\usepackage[table]{xcolor}
\usepackage{siunitx}
\usepackage{tabularray}
\UseTblrLibrary{booktabs, siunitx}
\usepackage[version=3]{mhchem}
\usepackage{booktabs}
\usepackage{tabularray}
\usepackage{siunitx}
\NewColumnType{V}[1]{X[m,c,si={table-format=#1}]}
\sisetup{table-number-alignment=center, exponent-product=\cdot}
\PassOptionsToPackage{hyphens}{url}
\usepackage{url}
\begin{document}
\begin{table}[h]
\begin{longtblr}[caption={Düngemittel Reinnährstoffabsatz von 1995/96 bis 2013/14 (Menge in t)},
remark{Quelle} = {\quad\parbox{0.85\linewidth}{\url{https://www.ama.at/getattachment/f3f479f8-6bc9-42e3-be83-d8fd4112a937/281_Dungemittel_Reinnahrstoffabsatz-ab-1995.pdf}\\(besucht am 20-01-2024)}}]{colspec={|X[m,c]|V{3.3}V{2.3}V{2.3}|},
row{even} = {brown!20}, row{1} = {brown!80}
}
\toprule
Jahr & {{{Stickstoff (N)}}} & {{{Phosphor (\ce{P2O5})}}} & {{{Kalium (\ce{K2O})}}} \\
\midrule
2013/14 & 111.615 & 32.731 & 32.559 \\
2011/12 & 97.721 & 26.198 & 32.478 \\
2009/10 & 90.639 & 22.121 & 23.356 \\
2007/08 & 134.382 & 44.704 & 49.787 \\
2005/06 & 103.692 & 34.979 & 40.738 \\
2003/04 & 100.789 & 39.357 & 49.532 \\
2001/02 & 127.585 & 47.138 & 50.099 \\
1999/00 & 121.644 & 48.548 & 55.241 \\
1997/98 & 127.537 & 57.264 & 61.537 \\
1995/96 & 125.309 & 52.272 & 59.755 \\
\bottomrule
\end{longtblr}
\end{table}
\end{document}
Note: Both the siunitx
and booktabs
packages can be used in a simple tabular environment. The first provides the option to perfectly typeset numbers (in this example, you can see that all the numbers have been aligned vertically by the dot), and the second one provides better spacing between rows and horizontal rules specifically designed for tables, such as \toprule
, \midrule
, and \bottomrule
.
\arrayrulewidth=0,25mm
outside the tabular but inside the table. You can move global changes to the preamble. Also, table (normally) does not have a required argument, so the "Ernstmalig ..." is simply treated as a line of text.\url
(url package) to handle the odd characters in the url.\resizebox
(or\scalebox
). This is always poor typesetting. And don't limit the float options toh
. Despite LaTeX does always useht
, ifh
does not work, I would always recommend to also allowp
. And if a table really must not float, you should not use a float. And please, next time don't show a code snippet, but a minimal working example starting with\documentclass
and ending with\end{document}
and with all packages loaded that are needed for the LaTeX run.