Misalignment of table columns when using multirow

I have a LaTeX document in which I am using custom environment and commands to make everything a bit easier. However, when I use the multirow command in one of my custom environments, the alignment of the left and right table columns is muddled (see below).

A minimum working example follows. Note that, in the case shown above, a multirow isn't required. However, there are other situations where the text in the left column is longer than a single table cell from the left column, and hence the multirow is required to prevent the contents of the right column from being spaced further apart.

\documentclass[10pt]{article}

\usepackage{filecontents}
\begin{filecontents*}{cvtools.sty}
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{cvtools}[2012/07/16 v1.0.0]

\RequirePackage{etoolbox}           % for \ifstrempty, \ifdef
\RequirePackage{ifthen}             % for \ifthenelse
\RequirePackage{longtable}          % for tables that span more than one page
\RequirePackage{multirow}           % for table columns that span more than one row
\RequirePackage{tabularx}           % for simple column stretching
\RequirePackage{xcolor}             % for colours

%================================================%
% Declare options
%================================================%

\DeclareOption*{\PackageWarning{cvtools}{Unknown option \CurrentOption'}}

\ProcessOptions

%================================================%
% For table styling
%================================================%
\definecolor{lightgray}{gray}{0.8}%
\newcolumntype{L}[1]{>{\raggedleft}p{#1}}%
\newcolumntype{R}[1]{p{#1}}%
\newcommand\VRule{\color{lightgray}\vrule width 0.5pt}%
%------------------------------------------------%

%================================================%
% \begin{education}
% \end{education}
%================================================%
\newenvironment{education}%
{%
\def\lwidth{0.16\textwidth}%
\def\rwidth{0.78\textwidth}%
%
%
\newcommand\educationItem[5]{%
% Check if we should display tools
\ifstrempty{##5}%
{% showGrades is true, but this \educationItem has no grades to display.
\gdef\@numRows{1}%
}%
\gdef\@numRows{2}%
}%
\else%
\gdef\@numRows{1}%
\fi%
%
% Education period
\multirow{\@numRows}{\lwidth}{##1 -- ##2}%
%
% Name and institution
& \textbf{##3 (##4)}%
%
{%
\\*%
& \begin{tabularx}{\rwidth}{Xr}%
##5%
\end{tabularx}%
}%
{}%
\\[0.5em]%
}%
%
\begin{longtable}{L{\lwidth}!{\VRule}R{\rwidth}}%
}%
{\end{longtable}}%
\end{filecontents*}

\usepackage[margin=3cm]{geometry}   % extend page margins

\begin{document}
\section*{Education}
\begin{education}
\educationItem{2008}{2012}
{Education 1}
{University 1}
{}

\educationItem{2002}{2007}
{Education 2}
{University 2}
{
}

\educationItem{January 2002}{December 2007}
{Education 3}
{University 3}
{
}
\end{education}
\end{document}


The third \educationItem demonstrates a longer entry which (I believe) justifies the use of multirow... without multirow I get something like this (note the undesired whitespace between "Education 3" and "Subject 1":

Any assistance would be greatly appreciated.

-
 I'm not sure what the effect you're trying to achieve is. Could you explain a little more what you mean about the column being "muddled" – Seamus Jul 18 '12 at 9:04 Why not showing one of those longer entries that would make necessary multirow? In my experience almost every usage of \multirow is unnecessary (there are other solutions, usually). – egreg Jul 18 '12 at 9:30 @Seamus Look at the image that I posted. The "2002-2007" on the left is not vertically aligned with the contents of the right column. – Joshua Spence Jul 18 '12 at 12:21 @egreg I added an example of why I believe I need multirow – Joshua Spence Jul 18 '12 at 12:28 @JoshuaSpence It's aligned with Education 3… What do you want it to align to? Subject 1? – Seamus Jul 18 '12 at 12:51
show 1 more comment

Just replace

\multirow{\@numRows}{\lwidth}{##1 -- ##2}%


with

\smash{\parbox[t]{\lwidth}{\raggedright ##1 -- ##2}}%


so that this entry won't contribute to the row height. It may be a problem when the right part is shorter than the left part, but I don't think it can really happen. In that case add dummy \educationGrade{}{} items.

Note. It's quite hard to understand why you're putting the definitions of \educationItemand \educationGrade in the body of the definition of education.

-
 Thanks, great... I agree that the \educationGrade definition shouldn't be where it currently is. I suppose I really want it to be nested within the \educationItem` command, but could not get this to work. – Joshua Spence Jul 18 '12 at 22:02