[Tex/LaTex] Vertically center the contents on a table

tablesvertical alignment

EDIT:

In order to make this question more beneficial for others, what I'm asking is how to simply vertically center the contents of a ''cell'', without having to modify all of the other parameters you have already established in the making of your table.

Is there any way to do this?

ORGINAL:

I'm trying to vertically center the contents of the following table:

\documentclass{article}
\usepackage[a4paper,margin=1in,landscape]{geometry}
\usepackage[utf8]{inputenc}
\usepackage[spanish]{babel}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{float}
\usepackage{array}

\begin{document}

\begin{center}
    {\large\textbf{{Gu\'ia Probabilidad}}}
    \noindent\makebox[\linewidth]{\rule{\textwidth}{1pt}}
\end{center}

\subsection*{Distribuciones Discretas:}

\begin{table}[H]
\center
    \begin{tabular}{||c|c|c|c|c|c c@{}||}
    \hline  
    Distribución & Funci\'on de masa de probabilidad & Par  \'ametros & Media & Varianza & Funci\'on generadora de momentos&\\
    \hline
    \hline
    \textit{Bernoulli} & $f(x) = p^x q^{1-x}I_{\{0,1\}}(x)$ & $0< p <1$ & $p$ & $p(1-p)$ & $(1-p) + pe^t$&\\[5ex]
    \hline
    \textit{Binomial} & $f(x) = \begin{pmatrix}n\\x\end{pmatrix}p^x(1-p)^{n-x}I_{0,1,\ldots,n}(x)$ & $0<p<1$ & $np$ & $np(1-p)$ & $(1-p + pe^t)^n$&\\[5ex]
\end{tabular}
\end{table}

\end{document}

I've already checked the answers of similar questions, but I just can't seem to find a simple answer. For example, the answers in this question distort the vertical alignment of my cells.

I think there just should be a really simple way to do this.

Thanks for the help.

PS for some reason I can't upload the image of my table…

Best Answer

like this?

enter image description here

\documentclass{article}
\usepackage[a4paper,margin=1in,landscape]{geometry}
\usepackage[utf8]{inputenc}
\usepackage[spanish]{babel}
\usepackage{amsmath, amssymb}
\usepackage{graphicx}
\usepackage{float}
\usepackage{array, makecell}
\setcellgapes{5pt}

\begin{document}

\begin{center}
    {\large\textbf{{Gu\'ia Probabilidad}}}
    \noindent\makebox[\linewidth]{\rule{\textwidth}{1pt}}
\end{center}

\subsection*{Distribuciones Discretas:}

\begin{table}[H]
\center
\makegapedcells
    \begin{tabular}{||c|c| c|c| c|c||}
    \hline
    Distribución & Funci\'on de masa de probabilidad & Par  \'ametros & Media & Varianza & Funci\'on generadora de momentos\\
    \hline
    \hline
    \textit{Bernoulli} &  $f(x) = p^x q^{1-x}I_{\{0,1\}}(x)$ & $0< p <1$ & $p$ & $p(1-p)$ & $(1-p) + pe^t$\\
    \hline
    \textit{Binomial} & $f(x) = \begin{pmatrix}n\\x\end{pmatrix}p^x(1-p)^{n-x}I_{0,1,\ldots,n}(x)$ & $0<p<1$ & $np$ & $np(1-p)$ & $(1-p + pe^t)^n$\\
\end{tabular}
\end{table}

\end{document}

note: in your mwe is defined seven columns, but used only six. therefore i deleted last (empty) columns. i use makecell package for adding vertical space to cells' contents.

edit: it seems that you looking for this:

enter image description here

\documentclass{article}
\usepackage[a4paper,margin=1in,landscape]{geometry}
\usepackage[utf8]{inputenc}
\usepackage[spanish]{babel}
\usepackage{amsmath, amssymb}
\usepackage{graphicx}
\usepackage{float}
\usepackage{array, makecell}
\setcellgapes{3pt}

\begin{document}

\begin{center}
    {\large\textbf{{Gu\'ia Probabilidad}}}
    \noindent\makebox[\linewidth]{\rule{\textwidth}{1pt}}
\end{center}

\subsection*{Distribuciones Discretas:}

\begin{table}[H]
\center
\makegapedcells
    \begin{tabular}{||c|c| c|c| c|c<{\rule[-2.2em]{0pt}{5em}} ||}
    \hline
    Distribución 
        & Funci\'on de masa de probabilidad 
            & Par  \'ametros
                & Media
                    & Varianza 
                        & \multicolumn{1}{c|}{%
                                    Funci\'on generadora de momentos}\\
    \hline
    \hline
    \textit{Bernoulli} &  $f(x) = p^x q^{1-x}I_{\{0,1\}}(x)$ & $0< p <1$ & $p$ & $p(1-p)$ & $(1-p) + pe^t$\\
    \hline
    \textit{Binomial} & $f(x) = \binom{n}{x}p^x(1-p)^{n-x}I_{0,1,\ldots,n}(x)$ & $0<p<1$ & $np$ & $np(1-p)$ & $(1-p + pe^t)^n$\\
    \hline
\end{tabular}
\end{table}

\end{document}

in above mwe i consider Mico comment below.

Related Question