[Tex/LaTex] Misplaced \noalign \hline

errorsrules

Unfortunately I cannot solve the error with \noalign on my own:

enter image description here

\begin{document}
\noindent  \LARGE{\textbf{John Smith}}  \\
\vspace{-2ex} 
\hline 
\normalsize

\begin{center}
\begin{tabular}{l l}
Name of University    & \hspace{1in} \href{mailto:john.smith@email.com}     {john.smith@email.com} \\
Department/Institution    & \hspace{1in}  \href{www.johnsmith.com} {www.johnsmith.com}   \\
Address             & \hspace{1in} Skype: \Absender  \\
City Name, State 12345-6789 & \hspace{1in} Phone: +1 (123) 456-7899 \\
\end{tabular}
\end{center}

I don't understand how to solve this.

Best Answer

Use \hrulefill outside tabular environment for horizontal line and for a constant space in a table column, give it in the declaration line as follows:

\documentclass{article}
\usepackage{hyperref}
\begin{document}
\noindent  \LARGE{\textbf{John Smith}} 

\noindent\hrulefill 

\normalsize

\begin{center}
\begin{tabular}{l @{\hskip1in}l}
Name of University    &  \href{mailto:john.smith@email.com}     {john.smith@email.com} \\
Department/Institution    &   \href{www.johnsmith.com} {www.johnsmith.com}   \\
Address             &  Skype: Absender  \\ %%removed \ from \Absender
City Name, State 12345-6789 &  Phone: +1 (123) 456-7899 \\
\end{tabular}
\end{center}
\end{document}

Output:

enter image description here