[Tex/LaTex] Increase the space between text and the horizontal line in a table

spacingtables

I have a problem with my table. Here's my code:

\documentclass{article}
\usepackage{eurosym}
\usepackage{enumerate}
\usepackage{fancyhdr}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage[spanish]{babel}
\usepackage{subfigure}
\usepackage{vmargin}
\usepackage{caption}
\usepackage{amsmath}


\begin{document}
    \title{\empty}
    \author{\empty }
    \date{\empty}


    \maketitle


    \begin{table}[h!]
        \begin{center}
            \begin{tabular}{l|l}
                \parbox{0.4\textwidth}{sudo ifconfig serviciosB down \\
                    sudo ifconfig serviciosA \\ 172.24.1.1/24 \\
                    sudo route add -net 172.24.2.0/24 gw 172.24.1.222 }             
                    & \parbox{0.4\textwidth}{sudo ifconfig serviciosA down 
                    \\
                    sudo ifconfig serviciosB \\ 172.24.2.1/24 \\
                    sudo route add -net 172.24.1.0/24 gw 172.24.2.222}   \\  
                    \hline
                    \parbox{0.4\textwidth}{sudo ifconfig serviciosB down \\
                    sudo ifconfig serviciosA \\ 172.24.1.2/24 \\
                    sudo route add -net 172.24.2.0/24 gw 172.24.1.222} & 
                    \parbox{0.4\textwidth}{sudo ifconfig serviciosA down \\
                    sudo ifconfig serviciosB \\ 172.24.2.2/24 \\
                    sudo route add -net 172.24.1.0/24 gw 172.24.2.222} \\
            \end{tabular}
        \end{center}
    \end{table}

\end{document}

The result of that table is this one:

Table

However, I'd like to increase the space between the text and the horizontal line of the middle of the table.

I hope someone can help me. Thank you for your responses.

Best Answer

You could use the appropriate p{...} column type, instead of putting parboxes in cells.

I created a new column type L which is ragged right but, of course, you can use p{...} directly, if you don't want the ragging.

I also redefined \arraystretch to have a bit more space.

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[spanish]{babel}
\usepackage{array}
\newcolumntype{L}{>{\raggedright\arraybackslash}p{.4\linewidth}}
\renewcommand{\arraystretch}{1.2}
\begin{document}
    \begin{table}[h!]
        \begin{center}
            \begin{tabular}{L|L}
               sudo ifconfig serviciosB down\newline 
               sudo ifconfig serviciosA \newline 172.24.1.1/24 \newline
                    sudo route add -net 172.24.2.0/24 gw 172.24.1.222
                    & sudo ifconfig serviciosA down 
                    \newline
                    sudo ifconfig serviciosB \newline 172.24.2.1/24 \newline
                    sudo route add -net 172.24.1.0/24 gw 172.24.2.222\\  
                    \hline
                   sudo ifconfig serviciosB down \newline
                    sudo ifconfig serviciosA \newline 172.24.1.2/24 \newline
                    sudo route add -net 172.24.2.0/24 gw 172.24.1.222 & 
                   sudo ifconfig serviciosA down \newline
                    sudo ifconfig serviciosB \newline 172.24.2.2/24 \newline
                    sudo route add -net 172.24.1.0/24 gw 172.24.2.222 \\
            \end{tabular}
        \end{center}
    \end{table}

\end{document}

enter image description here