\documentclass{article}
\usepackage{array}
\begin{document}
\begin{table}
\begin{tabular}{|>{$}c<{$}|>{$}c<{$}|}
1 & 2 \\
\end{tabular}
\end{table}
\begin{table}
\begin{tabular}{|>{$}c<{$}|>{$}c<{$}|}
3 & 4 \\
\end{tabular}
\end{table}
\end{document}
I am new to LaTeX.
I have a LaTeX file containing many large tables, each containing large number of columns.
All the tables have the same kind of columns, and need similar alignment and column widths.
I am looking for an easy way to specify a common alignment instruction for all of them (|>{$}c<{$}|>{$}c<{$}|
in the above example). Is there a way to specify and reuse the string |>{$}c<{$}|>{$}c<{$}|
(using \newcommand
or \let
or \def
etc), so that I can easily replicate the behavior in all my tables?