0

So I have something like this using \multicolumn:

        \begin{tabular}{lp{14cm}}
        \\\multicolumn{2}{c}{}    

        \\ &\textbf{Left header 1}      \hspace{40pt}\textsc{Right header 1}\\
        \\&\textbf{Left header 2} \hspace{40pt}\textsc{Right header 2}\\


        \\\multicolumn{2}{c}{}  
\end{tabular}   

How do I make "Right header 1" and "Right header 2" to line up? I am now using the \hspace but I think there should be a better solution? I cannot just use the & before both Right headers. So, doing this doesnt work:

\begin{tabular}{lp{14cm}}
        \\\multicolumn{2}{c}{}    

        \\ &\textbf{Left header 1}      &\textsc{Right header 1}\\
        \\&\textbf{Left header 2} &\textsc{Right header 2}\\


        \\\multicolumn{2}{c}{}  
    \end{tabular}

Please give me some help

A brief sketches:

---- align1 Left header 1------------| align2 Right header 1 
----- align1 some text---------------| align2 blank
------ align1 +bullet 1 in itemize---| align2 blank
------ align1 +bullet 2 in itemize---| align2 blank 
---- align1 Left header 2------------| align2 Right header 2 
  • Could you please extend your code fragments a bit more? I assume this is used in some kind of tabular or similar environment. Could you please add, which and how your columns are defined? So far I am also not sure about why you use \multicolumn. Some background information on the purpose of the code might also be helpful. – leandriis Feb 7 at 18:41
  • \documentclass{article} \begin{document} \begin{tabular}{ll} \textbf{Left header 1} & \textsc{Right header 1}\\ \textbf{Left header 2} & \textsc{Right header 2}\\ \end{tabular} \end{document} should work. – leandriis Feb 7 at 18:44
  • Thanks. But the reason why I am using \multicolumn is because I want to have an itemize environment. Say for example between Left header 1 and Left header 2. – mle0312 Feb 7 at 18:48
  • \\\multicolumn{2}{c}{} \\ &\textbf{Left header 1} \hspace{40pt}\textsc{Right header 1}\\ &\begin{itemize}....\end{itemize} \\&\textbf{Left header 2} \hspace{40pt}\textsc{Right header 2}\\ \\\multicolumn{2}{c}{} – mle0312 Feb 7 at 18:49
  • Basically, right after Right header 1, I can just do \\ & then do the itemize environment – mle0312 Feb 7 at 18:50
0

In the following example, I have used the enumitem package in order to define a new tabitem environment that can be sed inside of a tabular cell. You can use the value of leftmargin to adjust the indentation of the items. Depending on the actual contents of your tabular you might also need to adjust the column widths.

\documentclass{article}
\usepackage{enumitem}
\newlist{tabitem}{itemize}{1}
\setlist[tabitem]{nosep, leftmargin= 20pt ,label=\textbullet,after=\vspace{-\baselineskip},before=\vspace{-0.6\baselineskip}}

\begin{document}
\begin{tabular}{p{4cm}|l}
\textbf{Left header 1} & \textsc{Right header 1}\\
some text & \\
\begin{tabitem}
\item bullet 1 in itemize
\item bullet 2 in itemize
\end{tabitem} & \\
\textbf{Left header 2} & \textsc{Right header 2}\\
some text & \\
\begin{tabitem}
\item bullet 1 in itemize
\item bullet 2 in itemize
\end{tabitem} & \\
\end{tabular}
\end{document}

enter image description here

| improve this answer | |
  • Thank you so much! – mle0312 Feb 7 at 19:15

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.