[Tex/LaTex] Increasing the length between rows in a table

macrostables

I have defined a new command to increase the length between rows in a table:

\newcommand{\ra}[1]{\renewcommand{\arraystretch}{#1}}

For example

\documentclass[a4paper, 11pt]{article}

\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\newcommand{\ra}[1]{\renewcommand{\arraystretch}{#1}}

\begin{document}

\ra{3}
\begin{tabular}{ll}
\hline
col 1 & col 2 \\
\hline
1 & 2 \\
3 & 4 \\
5 & 6 \\
7 & 8 \\
\hline
\end{tabular}

\end{document}

Here is what it gives (left) and what I would like (right). That is, I would like the new command not to have any effect in the header.

enter image description here

Can you help me?

Best Answer

enter image description here

\documentclass[a4paper, 11pt]{article}

\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{array}

\newcommand{\ra}[1]{\renewcommand{\arraystretch}{#1}}

\begin{document}

\ra{3}
\begin{tabular}{ll}
\hline
\noalign{\vskip-12pt}
col 1 & col 2 \\
\noalign{\vskip-5pt}
\hline
1 & 2 \\
3 & 4 \\
5 & 6 \\
7 & 8 \\
\hline
\end{tabular}

\end{document}