# How to vertically align the contents of cells in NiceTabular?

I am trying to to vertically align cells contents in NiceTabular when they get significantly different heights. However, \adjustbox and makecell do not seem to work (neither does \adjustbox and \Block). Also, \adjustbox seems to provide no good alignment at the baseline of different rows (e.g., 2nd, 4th and 5th rows)

\documentclass{scrreprt}

\usepackage[x11names]{xcolor}

\usepackage{nicematrix}

\usepackage{makecell}

\begin{document}

{\centering

\begin{NiceTabular}[b]{|c|c|c|}[code-before=\cellcolor{DodgerBlue3}{3-1,2-2,1-3}, hvlines]
\hline
\\
\hline
\\
\hline
h & i & \makecell[c]{j \\ basmah \\ shafaamri}
\\
\\
\\
\hline
\end{NiceTabular}

}

\end{document}


You're overcomplicating things with adjustbox.

\documentclass{scrreprt}

\usepackage[x11names]{xcolor}

\usepackage{nicematrix}

\usepackage{makecell}

\begin{document}

\begin{NiceTabular}{|c|c|c|}[code-before=\cellcolor{DodgerBlue3}{3-1,2-2,1-3}, hvlines]
\hline
a & b & \includegraphics[width=0.47\linewidth,valign=m]{example-image-c} \\
\hline
a & b & \includegraphics[width=0.47\linewidth,valign=b]{example-image-c} \\
\hline
e & f & g \\
\hline
h & i & \makecell[c]{j \\ basmah \\ shafaamri} \\
h & i & \makecell[b]{j \\ basmah \\ shafaamri} \\
\hline
\end{NiceTabular}

\end{document}