0

I have a problem regarding the same file like described here: Centered cells with tabularx and linebreak Using that Code:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{tabularx}
\usepackage[]{multirow}
\usepackage[]{MnSymbol}
\usepackage[]{array}
\usepackage{multicol}

\begin{document}

\maketitle

\section{Introduction} \newcolumntype{P}[1]{>{\centering\arraybackslash}p{#1}} \begin{table} \centering \begin{tabularx}{1\linewidth}{lX|P{0.2\linewidth}|P{0.2\linewidth}|P{0.2\linewidth}} & & \textbf{firmware} & \textbf{bootloader} & \textbf{os} \ \multicolumn{2}{l}{\textbf{Target1}} & & & \ & {\footnotesize rot\par} & test123 \newline hallo & {\footnotesize $(\uparrow)$ \newline testtext\par} & {\footnotesize $(\nearrow)$ \newline hardware\par} \ \hline \hline \end{tabularx} \end{table}

\end{document}

Will result in enter image description here

Is there anyway to align the first cell with in the mid of the other cells? Regardless if there are two, three, one or four lines in the cells?

  • Define ˛column tapy P as \newcolumntype{P}[1]{>{\centering\arraybackslash}m{#1}} \begin{table}, however, your table is a bit unusual ... – Zarko Aug 31 '22 at 12:24

1 Answers1

0

Something like this below?

enter image description here

\documentclass{article}
\usepackage{array}
\usepackage{tabularx}
% \usepackage{multirow}
\usepackage{makecell}
\usepackage{MnSymbol}

\newcolumntype{P}[1]{>{\centering\arraybackslash}p{#1}} \newcolumntype{C}{>{\centering\arraybackslash}X}

\begin{document} \section{Introduction} \begin{table} \renewcommand\theadfont{\normalsize\bfseries}% \setlength\tabcolsep{3pt} \centering% \footnotesize% \begin{tabularx}{\linewidth}{ C| P{0.2\linewidth}| P{0.2\linewidth}| P{0.2\linewidth} } \thead{Target1} & \thead{firmware} & \thead{bootloader} & \thead{os} \ rot & \makecell[cc]{$(\uparrow)$ test123\hallo} & $(\uparrow)$ testtext & $(\nearrow)$ hardware \ \hline\hline \end{tabularx} \end{table}

\end{document}

Celdor
  • 9,058