Question: So, I'm trying to write a Table with some information and for the first time in my life im using multirow and multicolumn. Everything was going kind of ok until I decided to use `\hline` and, as you can see in the code, one of the horizontal lines is going through a multicolumn and writing over my text.

> 
> Can someone tell me how I can prevent this from happening?
> 
> 
> 

```
\begin{table}[]
\begin{tabular}{|c|c|c|}
\hline
\multicolumn{2}{|c|}{\textbf{Item}}                             & \textbf{CPU33} \\ \hline
\multicolumn{2}{|c|}{Dimensiones}                      & A     \\ \hline
\multicolumn{2}{|c|}{Consumo}                          & B     \\ \hline
\multirow{4}{*}{Ambiente de operación} & Temperatura & C     \\ \hline
                                       & Ruido       & D     \\ \hline
                                       & Vibración   & E     \\ \hline
                                       & Schock      & F     \\ \hline
\end{tabular}
\end{table}

```

[![My current table](https://i.stack.imgur.com/09YgW.png)](https://i.stack.imgur.com/09YgW.png)

Answer: 
Your problems are not linked to the command `\Block` (provided by `nicematrix`) since the command `\Block` is *not* used in both cells with problems (however, using `\Block` in those cells won't solve the problems since the command `\Block` does not create space).

In fact, your problems would arise in a standard `{tabular}` of LaTeX (provided you use explicitely `\rotatebox` instead of the syntactic variant `\rotate` provided by `nicematrix`).

---

For the first cell (whose content is `Średnia wartość czegoś tam`), I suggest to use the command `\gape` provided by `makecell` since you have used the command `\makecell`.

That gives : `\gape[t]{\makecell{Średnia wartość\\czegoś tam}}`.

---

```
\documentclass{article}
\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}{\gape[t]{\makecell{Średnia wartość\\czegoś tam}}} & 
{\Block{2-1}<\rotate>{Obrócony opis\\kolumny B}} \\
{\Block{2-1}<\rotate>{straszne dane}}
&{\Block{}<\rotate>{inne dane\\z długim opisem\;}}\\
& {A} & {B} \\
63.5 & 4.87 & 63.5\\
88.4 & 5.13 & 88.4\\
\end{NiceTabular}
\end{document} 

```

[![Output of the above code](https://i.stack.imgur.com/x4GSh.png)](https://i.stack.imgur.com/x4GSh.png)
For the `blocks`, the text is already at the center. If you want to shift further, use `\hspace` to achieve the desired output. For the `spacing`, you can try adjusting the cell width else reduce the size of the text, so that the text will not touch the cell border. This can be achieved by using `\small` or `\scriptsize`. Just use it before the text.

```
\documentclass[table]{standalone}
\usepackage{siunitx}
\usepackage{makecell}
\usepackage{nicematrix}

\begin{document}
\centering
\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{\scriptsize{Średnia wartość}\\\scriptsize{czegoś tam}}} & 

{\Block{2-1}{\hspace{-.4cm}\rotate \makecell{Obrócony opis\\kolumny B}}} \\
{\Block{2-1}{\centering\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} 

```

Edited answer after comment:

```
\documentclass[table]{standalone}
\usepackage{siunitx}
\usepackage{makecell}
\usepackage{nicematrix}

\begin{document}
\centering
\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{\scriptsize{\textbf{Średnia wartość}}\\\scriptsize{\textbf{czegoś tam}}}} & 

{\Block{2-1}{\hspace{-.4cm}\rotate \makecell{\small \textbf{Obrócony opis}\\\small\textbf{kolumny B}}}} \\
{\Block{2-1}{\centering\rotate \makecell{\small \textbf{straszne dane}}}}
& \rotate \makecell{\scriptsize \textbf{inne dane}\\\scriptsize \textbf{z długim opisem}} \\
& {A} & {B} \\
63.5 & 4.87 & 63.5\\
88.4 & 5.13 & 88.4\\
\end{NiceTabular}
\end{document} 

```