I looked at your table and redid its first part - the "var" part. Since latex building tables are not my specialty, the code looks pretty dirty but does the job. Relevant packages multirow- to achieve nested tables - and verbatimto get the required verbatim environment. As you will see, I had to use an additional minipagesdescriptor for the correct placement of the shorthand environment. You can comment on them to see the difference. In addition, I started the table with the following row
\begin{tabular}{|l|l|l|p{8cm}|}
otherwise, if you do not use p-aragraph colums for the last column, you may get some errors using the specified environments inside the columns.
latex-wikibooks, .
.tex:
\documentclass[11pt]{article}
\setlength{\textwidth}{20.0cm}
\usepackage{verbatim}
\usepackage{multirow}
\begin{document}
\begin{tabular}{|l|l|l|p{8cm}|}
\hline
Element & Type & Case & Template\\ \hline
\multirow{4}{*}{} Var & id & escaping or diff. level &
\begin{minipage}[t]{\linewidth}
\begin{verbatim}
return [offset](\%ebp)
\end{verbatim}
\end{minipage}
\\ \cline{3-4}
& & else &
\begin{minipage}[t]{\linewidth}
\begin{verbatim}
return TEMP(n)
\end{verbatim}
\end{minipage} \\ \cline{2-4}
& index & - &
\begin{minipage}[t]{\linewidth}
\begin{verbatim}
a = A_var(var)
movl a, t1
// do runtimecheck 5
t2 = A_exp(exp)
movl t2, t3
addl $1, t3
return (t1, t3, 4)
\end{verbatim}
\end{minipage} \\ \cline{2-4}
& field & - &
\begin{minipage}[t]{\linewidth}
\begin{verbatim}
a = A_var(var)
movl a, t1 // hvis a ikke er temp
// do runtimecheck 5
movl [offset], t3
return (t1, t3, 4)
\end{verbatim}
\end{minipage}
\\ \hline
\end{tabular}
\end{document}