# Aligned equations in tables [duplicate]

This question already has an answer here:

I'm new to LaTeX. I'm trying to create a table where one of the cells contains aligned equations.

The naive approach of nesting an align environment inside the table environment does not work:

\begin{tabular}{l r}
A & B\\
\begin{align}
x &= y+1\\
x &= (y+1) (y-1)
\end{align}
\end{tabular}


This gives the error 'Argument of \align has an extra }.'

I must admit I have no idea what that error message means... Why is it not possible to nest align and table environments? How do I put aligned equations in a table?

Thanks!

## migrated from stackoverflow.comMar 3 '14 at 20:13

This question came from our site for professional and enthusiast programmers.

As you've discovered, you can't use an align (or align*) environment inside a tabular environment, unless you go to some lengths to "hide" the align environment.

A simple remedy is available: Use an aligned environment. Optionally, use a [t] or [b] placement specifier to specify if you want top- or bottom-alignment. If you don't provide a placement indicator, any adjacent material will be centered vertically relative to the material in the aligned environment.

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{tabular}{lr}
A & B\\
\hline
\begin{aligned}[t] % placement: default is "center", options are "top" and "bottom" x &= y+1\\ x &= (y+1) (y-1) \end{aligned} & abc xyz\\
\end{tabular}
\end{document}

• +1 for option [t]. – IgotiT Jul 12 '17 at 6:40