- Your MWE contain errors (color names).
- Added is use of
siunitx
columns.
- Interchanged are Q and X columns ...
- for column headers I would use
\small\bfseries
font size
Edit:
- We should be aware, that tags in
TblrNote
are in case of use hyperref
package are defined by it. That tags in TblrNote
will be visible, it is need to locally changed hyperref
setup so, that color of tags will be the same as color of text in rows.
- Since in table is used
siunitx
packages, the column headers should be in parenthesis. That hyper links will work \TblrNote
had to be outside of them:
\documentclass{scrartcl}
\usepackage[svgnames]{xcolor}
\usepackage{tabularray}
\UseTblrLibrary{booktabs, siunitx}
\sisetup{group-minimum-digits=4}
\usepackage{hyperref}
\hypersetup{%
colorlinks = true,
linkcolor = blue % color is the same as the first row color!
}
\begin{document}
\begin{longtblr}[%
note{a}={Figures in EUR},
note{b}={Not all figures in EUR},
]{%
colsep = 2pt,
colspec = {*{2}{Q[l]}
*{3}{X[c, si={table-format=3.1}]}
*{2}{X[1.1, c, si={table-format=5.1}]}
X[0.8, c, si={table-format=5.1}]
},
row{odd} = {bg=LightBlue},
row{1} = {bg=blue, fg=white, font=\small\bfseries,
cmd={\hypersetup{linkcolor=white}} % needed that `TblrNote` tag become visible
},
rowhead = 1
}
\toprule[blue]
Project
& Species
& {{{Quantity}}}
& {{{Average number of weeks kept}}}
& {{{Housing costs per animal per week}}}\TblrNote{a}
& {{{Purchasing costs per animal}}}\TblrNote{a}
& {{{Requested funds}}}\TblrNote{a}
& {{{Existing funds\TblrNote{a}}}} \\
\midrule[blue]
Hello & World & 123 & 45.6 & 789 & 10992.0 & 11223.5 & 32012.2 \\
Hello & World & 456 & 78.9 & 123 & 10992.0 & 6789.0 & 1234.5 \\
Hello & World & 123 & 45.6 & 789 & 10992.0 & 11223.5 & 32012.2 \\
Hello & World & 456 & 78.9 & 123 & 10992.0 & 6789.0 & 1234.5 \\
\bottomrule[blue]
\end{longtblr}
\end{document}
Addendum:
With tabularray
package version newer than 2022A the table code can be a bit simpler:
\documentclass{scrartcl}
\usepackage[svgnames]{xcolor}
\usepackage{tabularray}
\UseTblrLibrary{booktabs, siunitx}
\sisetup{group-minimum-digits=4}
\usepackage{hyperref}
\hypersetup{%
colorlinks = true,
linkcolor = blue % color is the same as the first row color!
}
\begin{document}
\begin{longtblr}[%
note{a}={Figures in EUR},
note{b}={Not all figures in EUR},
]{%
colsep = 2pt,
colspec = {*{2}{Q[l]}
*{3}{X[c, si={table-format=3.1}]}
*{2}{X[1.1, c, si={table-format=5.1}]}
X[0.8, c, si={table-format=5.1}]
},
row{odd} = {bg=LightBlue},
row{1} = {guard, % <---
font=\small\bfseries,
fg=white, bg=blue,
cmd={\hypersetup{linkcolor = white}}, % needed that `TblrNote` tag be visible
},
rowhead = 1
}
\toprule[blue]
Project
& Species % <---
& Qnty % <---
& Average number of weeks kept % <---
& Housing costs per animal per week\TblrNote{a} % <---
& Purchasing costs per animal\TblrNote{a} % <---
& Requested funds\TblrNote{a} % <---
& Existing funds\TblrNote{a} % <--- \\
\midrule[blue]
Hello & World & 123 & 45.6 & 789 & 10992.0 & 11223.5 & 32012.2 \\
Hello & World & 456 & 78.9 & 123 & 10992.0 & 6789.0 & 1234.5 \\
Hello & World & 123 & 45.6 & 789 & 10992.0 & 11223.5 & 32012.2 \\
Hello & World & 456 & 78.9 & 123 & 10992.0 & 6789.0 & 1234.5 \\
\bottomrule[blue]
\end{longtblr}
\end{document}
Compilation result is the same as before.
Similar functionality as scrextend
offer package changepage
. With its macro
\begin{adjustwidth}{left margin}{right margin}
or
\begin{adjustwidth*}{}{outer margin}
locally change text margins. More detail description is in package documentation. In your case your MWE should be changed to:
\documentclass{article}
\usepackage{tabularray}
\usepackage[strict]{changepage}
\usepackage{lipsum}
\begin{document}
\lipsum[66]
\begin{table}[ht]
\begin{adjustwidth}{-15mm}{-15mm}
\begin{talltblr}[
caption = {hello},
label = {tab:??}]{hlines, vlines, % that width of table is clearly seen
colspec={X[c]}
}
Hello world!
\end{talltblr}
\end{adjustwidth}
\end{table}
\lipsum[66]
\end{document}
Best Answer
Maybe what you want is a both
X
andS
column? Just writeX[si]
intabularray
.PS:
tabularray
package doesn't support the usage of@{\extracolsep{\fill}}
, and normally you don't need it.