[Tex/LaTex] Aligning inside a table across a column

alignarraysmath-modetables

I have a table in which a column looks like this:
a column in a table

I want to align the $\ge$ signs one below the other. How do I achieve this?

I was also hoping that the solution would be generalizable, in the sense that similar to normal align environment, I could have multiple 'columns' of alignment inside this column (i.e. coeffs of $v_1$ would be aligned, coeffs of $v_2$ would be aligned, and so on). So I guess I want something more general than right alignment.

Also note that I have some columns to the left and right of this column.

Note: I am using array environment to introduce math mode throughout the column (| >{$}c<{$} |).

Best Answer

Here's a way to embed the math-y material in a three-column tabular environment. Note the use of a two-column array environment, where the columns are separated automatically by \ge (greater than or equal) symbols.

Aside: I find all those horizontal lines highly distracting. If it were my table, I'd get rid of the interior horizontal lines.

enter image description here

\documentclass{article} 
\begin{document}
\begin{table}
\centering
\begin{tabular}{|l|@{}l@{}|l|}
  \hline
  column 1 material & 
  $\begin{array}[t]{ r @{{}\ge{}} l }
                      v_2 & 0 \\ \hline
      (k-1)v_2 - (k+1)v_3 & 0 \\ \hline
                     kv_3 & 0 \\ \hline
              kv_2 - kv_3 & 0 \\ \hline
    (k+1)v_1 + (-2k+1)v_2 & 1 
  \end{array}$ &
  column 3 material \\ 
  \hline
\end{tabular}
\end{table}

\end{document}

Addendum: It's straightforward to extend this array-based approach to handle not just two columns but, say, six columns:

enter image description here

\documentclass{article} 
\usepackage{array}
\begin{document}
\begin{table}
\centering
\begin{tabular}{|l|@{}l@{}|l|}
  \hline
  column 1 material & 
  $\begin{array}[t]{ *{2}{r @{} >{{}}c<{{}} @{}} r @{{}\ge{}} l }
      & &      v_2 &   &          & 0 \\ \hline
      & & (k-1)v_2 & - & (k+1)v_3 & 0 \\ \hline
      & & & &                kv_3 & 0 \\ \hline
      & &     kv_2 & - &     kv_3 & 0 \\ \hline
  (k+1)v_1 & + & (-2k+1)v_2 & & & 1 
  \end{array}$ &
  column 3 material \\ 
  \hline
\end{tabular}
\end{table}
\end{document}
Related Question