I have the following table almost finished (I tried to make the code as much readable as I could)
\documentclass{article}
\usepackage[table]{xcolor}
\usepackage{tikz}
\usepackage{mathtools}
\usepackage{array}
\begin{document}
\begin{center}
\renewcommand{\arraystretch}{1.6}
\begin{equation*}
\begin{array}{ | >{\centering\arraybackslash$} p{4.0cm} <{$}
| >{\centering\arraybackslash$} p{4.0cm} <{$}
| >{\centering\arraybackslash$} p{4.0cm} <{$}
| } \hline
a+\infty=\infty & a-\infty=-\infty & \infty+\infty=\infty \\ \hline % End of 1st row
-\infty-\infty=-\infty & \infty\cdot\infty=\infty & -\infty\cdot\infty=-\infty \\ \hline % End of 2nd row
\dfrac{a}{\infty}=0 &
\dfrac{a}{0}=
\left\{ \renewcommand{\arraystretch}{1}
\begin{tabular}{c}
$ \infty $ si $ a>0 $\\
$ -\infty $ si $ a<0 $
\end{tabular} \right.\ &
\infty^a=
\left\{ \renewcommand{\arraystretch}{1}
\begin{tabular}{c}
$ \infty $ si $ a>0 $\\
$ 0 $ si $ a<0 $
\end{tabular}\right.\ \\ \hline % End of 3rd row
\infty^\infty=\infty&\infty^{-\infty}=0&
a^\infty=
\left\{ \renewcommand{\arraystretch}{1}
\begin{tabular}{c}
$ \infty $ si $ a>1 $\\
$ 0 $ si $ 0\leq a<1 $
\end{tabular}\right.\ \\ \hline % End of 4th row
\cellcolor{gray!25}& 0^a=0\text{ si $ a>0 $} &\cellcolor{gray!25} \\ \hline % End of 5th row
\end{array}
\end{equation*}
\end{center}
\end{document}
Several problems here:
- I managed to make the columns to have the same width but I have to copy-paste that code every time I want to make a column with that property (maybe some redefinition with
\renewcommand
?) - When I use
tabular
inside thearray
environment the curly brackets are too close from the cell limits, and I wonder if you can redefine the size of all the cells of those rows to fit those tables. - Is there an option that
array
(ortabular
) could get that stretch the array without having to use\renewcommand{\arraystretch}{<number>}
every time I make a new table?
I'm looking for a general solution, not only for this problem, since I will define a lot of tables in my next report, and for sure a lot of people will appreciate a general solution since I see lots of questions about this mysterious world of LaTeX tables.
\begin{center}\begin{equation*}
is not a correct way to center equations.