I'm trying to create essentially a "new command" or "new environment" with a tabular environment. Is there any possibility to make a simple command that allows me to enter the size of the table and its corresponding entries. For instance, I want to make a command that makes the first table and just change a few numbers to create the second table. How would I accomplish this? Please let me know and thank you.
\begin{document}
\[
\begin{tabular}{>{$}c<{$}|*{8}{>{$}c<{$}}}
& E & 2A & B & 2C & 2D\\
\hline
\vrule height 12pt width 0pt
\Gamma_1 & (1) & (1) & (1) & (1) & (1)\\
\Gamma_2 & 1 & (1) & 1 & -1 &-1 \\
\Gamma_3 & 1 & -1 & 1 & 1 & -1\\
\Gamma_4 & 1 & -1 & 1 & (-1) & 1\\
\Gamma_5 & (2) & 0 & (-2) & 0 & 0\\
\end{tabular}
\]
\[
\begin{tabular}{>{$}l<{$}|*{8}{>{$}l<{$}}}
C_{3\si{v}} & E & C_3 & C_3^2 & \sv & \sv' & \sv'' \\
\hline
\vrule height 12pt width 0pt
E & E & C_3 & C_3^2 & \sv & \sv' & \sv'' \\
C_3 & C_3 & C_3^2 & E & \sv'' & \sv & \sv' \\
C_3^2 & C_3^2 & E & C_3 & \sv' & \sv'' & \sv\\
\sv & \sv & \sv' & \sv'' & E & C_3 & C_3^2\\
\sv' & \sv' & \sv'' & \sv & C_3^2 & E & C_3\\
\sv'' & \sv'' & \sv & \sv' & C_3 &C_3^2 & E\\
\end{tabular}
\]
\end{document}
\si
and\sv
defined?tabular
has 5 (not 8) data columns and 5 data rows, whereas the secondtabular
has 6 each. Are you looking for an algorithmic way to go from a 5x5 to a 6x6 table?\Tstrut
-- e.g.,\newcommand\Tstrut{\vrule height 12pt width 0pt}
-- to simplify inputting a "top strut".