[Tex/LaTex] Move left-aligned text to the right

align

I'm trying to align a document heading (myName, myPhone, myMail) which I want to show on the right. For instance,

                                                        myName
                                                        myPhone
                                                        myMail

I've tried something like this, but it does not seem to work

\hspace{12cm} myName \newline
\hspace{12cm} myPhone \newline
\hspace{12cm} myMail

I would be grateful to receive some helpful advice. Thank you.

Best Answer

If you want the block of 3 lines aligned on left but pushed to right, use

\begin{flushright}
  \begin{tabular}{l@{}}
    myName\\myPhone\\myMail
  \end{tabular}
\end{flushright}

or only flushright to push everything to right.

MWE

\documentclass[letterpaper,12pt]{article}
\usepackage{lipsum}

\begin{document}
\lipsum[1]
\begin{flushright}
  \begin{tabular}{l@{}}
    myName\\myPhone\\myMail
\end{tabular}
\end{flushright}
\lipsum[2]
\begin{flushright}
%  \begin{tabular}{l}
    myName\\myPhone\\myMail
%\end{tabular}
\end{flushright}
\end{document}

enter image description here

Related Question