I am making table using both nicematrix and makecell packages, because these packages applied together allow to obtain multirow heading cells containing rotated text (as pointed here; if I am not wrong, makecell package alone enables making cells with rotated text, enables merging vertically adjacent cells, but not both for a single cell).
I need to highlight table-heading content by setting not only gray background, but also bold font. I have two problems/questions:
- The content of
\Blockis shifted upward from the cell center - letterŚtouches top bounding line of the cell (see picture below); and lettermin the cell with rotated text almost touches the corresponding bounding line of the cell. How to center\Blockcontent automatically? - Does the
\Blockcommand enable for application bold footnotesize font for a group of cells, like\renewcommand{\theadfont}{\footnotesize\bfseries}inmakecellpackage?
Code:
\documentclass[table]{standalone}
\usepackage{siunitx}
\usepackage{makecell}
\usepackage{nicematrix}
\renewcommand{\arraystretch}{1.3}
\begin{document}
\begin{NiceTabular}[hvlines,code-before=\rowcolor{gray!30}{1-3}]{%
S[table-format=2.1]
S[table-format=1.2]
S[table-format=2.1]
}
\multicolumn{2}{c}{\makecell{Średnia wartość\czegoś tam}} &
{\Block{2-1}{\rotate \makecell{Obrócony opis\kolumny B}}} \
{\Block{2-1}{\rotate \makecell{straszne dane}}}
& \rotate \makecell{inne dane\z długim opisem} \
& {A} & {B} \
63.5 & 4.87 & 63.5\
88.4 & 5.13 & 88.4\
\end{NiceTabular}
\end{document}


\bfseriesinto angle brackets after\Blockcommand (I would like to make bold the whole content of the table heading, which is already marked by gray background). But without success. Is the\Blockargument in angle brackets dedicated only for mathematical mode? How to set font globally for the whole heading, including cells made with\multicolumnas well as\Blockcommands? – forrest Oct 01 '20 at 05:20{NiceTabular}, there is no need to such argument: you may simply put your command\bfseriesin the main argument of\Block:\Block{2-2}{\bfseries My text}. In arrays in math mode, it's not possible to put a command such as\Largein math mode and that's why I've created the options in angular brackets. – F. Pantigny Oct 01 '20 at 05:28{\Block{2-1}{\bfseries\rotate \makecell{Obrócony opis\\kolumny B}}}. It works. – forrest Oct 01 '20 at 08:21