0

I am trying to align column entry in 1st column and 2nd row with corresponding second column entry.

I am using following code

\documentclass{article}
\usepackage{array}
\begin{document}

\begin{tabular}{>{\bfseries}l l l}
a \ & & 1, 2, 3 \\
b & & \begin{tabular}[l]{@{}l@{}} 1\\ 2\\ 3\end{tabular} \\
c & & 1, 2, 3 \\

\end{tabular}


\end{document}

What parameter do I need to change so that b is not in center of 1 2 3 but it should be at top next to value 1. Desired Output:

a       1,2,3
b       1
        2
        3
c       1,2,3

2 Answers 2

1

enter image description here

Like this

\documentclass{article}
\usepackage{array}
\begin{document}

\begin{tabular}{>{\bfseries}l l l}
a & & 1, 2, 3 \\
b & & 1, 2, 3 \\
c & & 1, 2, 3 \\

\end{tabular}


\end{document}

EDIT

following OP edit

Or this

enter image description here

\documentclass{article}
\usepackage{array}
\begin{document}

\begin{tabular}{>{\bfseries}l l l}
a & & 1, 2, 3 \\
b & & 1        \\
  & & 2         \\
  & & 3         \\
c & & 1, 2, 3 \\

\end{tabular}


\end{document}
1
  • This is not what I want kindly look at desired output as stated in question. Commented Feb 9, 2020 at 14:35
1

THree other solutions; you can do that either withmakecell or with stackengine (\Shortunderstack or \Longunderstack):

\documentclass{article}
\usepackage{array, makecell}
\usepackage[usestackEOL]{stackengine}

\begin{document}

\begin{tabular}{>{\bfseries}l l l}
a \ & & 1, 2, 3 \\
b & & \makecell[tl]{1\\ 2\\ 3} \\
c & & 1, 2, 3 \\
\end{tabular}
\qquad
\begin{tabular}{>{\bfseries}l l l}
a \ & & 1, 2, 3 \\
b & & \Longunderstack[l]{1\\2\\ 3} \\
\noalign{\vskip 0.6ex}
c & & 1, 2, 3 \\
\end{tabular}
\qquad
\begin{tabular}{>{\bfseries}l l l}
a \ & & 1, 2, 3 \\
b & & \Shortunderstack[l]{1\\2\\ 3\\} \\
c & & 1, 2, 3 \\
\end{tabular}

\end{document} 

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .