[Tex/LaTex] Table Line above

rulestables

\begin{center}
\captionof{table}{Register Table} \label{tab:title} 
\begin{tabulary}{1.2\textwidth}{| p{3cm} || C | p{3cm} | C | C p{1cm} | }
Procedure        & Expected Outcome         & Pass or Fail           \\ \hline
1. Click on Register button when one or more fields are empty   & An error message should     error beside affected fields       & yes  \\ \hline          
\end{tabulary}  
\end{center}

Struggling with organising this table, i.e. getting the very top line to draw on top of the rows? Also any ideas on why the pass or fail column text is positioned to the far left when I need it in the center?

Best Answer

enter image description here

This corrects the number of columns and the total width and adds another line:

\documentclass{article}
\usepackage{tabulary,capt-of}
\begin{document}


\begin{center}
\captionof{table}{Register Table} \label{tab:title} 
\begin{tabulary}{1.2\textwidth}{| p{3cm} || C | p{3cm} | C | C p{1cm} | }
Procedure        & Expected Outcome         & Pass or Fail           \\ \hline
1. Click on Register button when one or more fields are empty   & An error message should     error beside affected fields       & yes  \\ \hline          
\end{tabulary}  
\end{center}


\begin{center}
\captionof{table}{Register Table} \label{tab:title} 
\setlength\extrarowheight{2pt}

\begin{tabulary}{\textwidth}{| C | C | C| }
\hline
Procedure        & Expected Outcome         & Pass or Fail           \\ \hline
1. Click on Register button when one or more fields are empty   & An error message should     error beside affected fields       & yes  \\ \hline          
\end{tabulary}  
\end{center}


\noindent X\dotfill X

\noindent X\dotfill X

\end{document}
Related Question