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
| improve this question | | | | |
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}
| improve this answer | | | | |
  • This is not what I want kindly look at desired output as stated in question. – Furqan Hashim Feb 9 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

| improve this answer | | | | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.