# Text and picture top-aligned, where text is left-aligned and picture is right aligned

Using the answers from this sight, I tried to accomplish top-aligned text and image where text would have to start from the left side of the page, and picture would be at the right side. However, using any method of stretching the table to the page width resulted in top alignment not working (tabularx or tabular* equally).

How can I keep the picture right-aligned and text top-aligned with picture at the same time?

\documentclass[border=10pt]{standalone}
\usepackage{pst-barcode}
\usepackage[crop=off]{auto-pst-pdf}

\begin{document}

\begin{tabular*}{\textwidth}{l @{\extracolsep{\fill}} r}
\vspace{0pt}Title Text &
\vspace{0pt}
\begin{pspicture}(0.7in,0.7in)
\psbarcode{http://www.ctan.org}{}{qrcode}
\end{pspicture}
\end{tabular*}

\end{document}


It did top-align text and picture when tabular was defined as follows:

\begin{tabular}{p{0.8\textwidth} p{0.8in}}
\vspace{0pt}Title Text &
\vspace{0pt}
\begin{pspicture}(0.7in,0.7in)
\psbarcode{http://www.ctan.org}{}{qrcode}
\end{pspicture}
\end{tabular}

• \vspace has no effect in a cell in an r column. – egreg Jun 20 '14 at 15:19
• I guess it does not, but the question remains. – ajeh Jun 20 '14 at 15:20

\vspace{0pt} works in a p column because it's set in a \parbox. For an r column you can use adjustbox:

\documentclass{article}
\usepackage{pst-barcode}
\usepackage[crop=off]{auto-pst-pdf}

\begin{document}

\begin{tabular*}{\textwidth}{@{}l @{\extracolsep{\fill}} r@{}}
Title Text &
\begin{pspicture}(0.7in,0.7in)
\psbarcode{http://www.ctan.org}{}{qrcode}
\end{pspicture}
\end{tabular*}

\end{document}


Do similarly if you want line breaks in the first cell:

\documentclass{article}
\usepackage{pst-barcode}
\usepackage[crop=off]{auto-pst-pdf}

\begin{document}

\begin{tabular*}{\textwidth}{@{}l @{\extracolsep{\fill}} r@{}}
\begin{tabular}[t]{@{}l@{}}
Title\\ Text
\end{tabular} &
\begin{pspicture}(0.7in,0.7in)
\psbarcode{http://www.ctan.org}{}{qrcode}
\end{pspicture}

• @ajeh It mostly depends on how you do the line breaks: is the text in a p cell? – egreg Jun 20 '14 at 15:35
• Just what's in MWE. Example: Title\\Text pushes text above the picture :( I am trying to use space below the title for things like 'as of Jun 20, 2014' etc. – ajeh Jun 20 '14 at 15:48
• What is the significance of @{}? – ajeh Jun 20 '14 at 16:16