0

I have the following but in the cells where there are the results the cell box lines are not showing correctly as you can see in the screenshot. Any help to solve this? Thanks

Table

\begin{table}[htbp]
\centering
\begin{tabular}{|{1cm}|{2.5cm}|{2.5cm}|{2.5cm}|} 
\hline
Question & Yes & No & Maybe  \\ 
\hline
As a Coach, would you use this type \\ of system instead of the traditional 
method?        
&   11   &  2     &    2     \\ 
\hline 
Do you think that this system will \\ save you time to identify a player's 
position?         & 9     &  2    &  4  \\
\hline
Does the system has any errors/bugs \\ that interfered during the testing?     
&   3     &  12   &  0 \\
\hline
Do you think the system achieved the \\ necessary results for your work?    
& 10  &  4   &   1 \\
\hline
Is the System user-friendly to use?        &
14  &  0   &  1  \\
\hline
\end{tabular}
\label{table:3}
\end{table}

Result.

Result Screenshot

2
  • Could you please make your example compilable by adding the documentclass and the relevant packages? Apart from that, {1cm} is not the correct syntax to specify a table column. Maybe you wanted to use p{1cm} instead. If I use p type columns for all the coluns, I get a different output than you, as the first column is a lot narrower than the last three.
    – leandriis
    Commented Jun 3, 2019 at 11:39
  • 1
    Also, there is no need for manual linebreaks if you use p (or m) type column, so simply correct the column specifications and remove the \\ within the question text and your table should be fine.
    – leandriis
    Commented Jun 3, 2019 at 11:41

1 Answer 1

1

Your code contains invalid column specifications. Instead of {1cm} you maybe intended to use p{1cm}. However, if I add the missing letters to make the code compilable, I don't get the output you show in your question as the first column is very narrow. Changing the column specifier of the first column to p{7cm} or something else and the last three columns to c type columns gives us a result that is close to the screenshot.

The missing vertical lines are caused, because the second row of your table misses three &signs. If you add them, the vertical lines will be complete. However, if you use p type columns, there is no need for manual linebreaks. See first table in my MWE.

If you nevertheless insist on manual linebreaks inside of table cells, use \newline insead of \\. To horizontally center the text in the first column, use >{\Centering}p{7cm}. If you also want vertically centered, text, replace p by m. (See second table in my MWE).

Personally, I would suggest a different layout using the tabularx package for an X type column that automatically calculates the width of the respective column so that the whole table is as wide as a specified widht (textwidth inn my example). Also I'd avoid vertical lines and replace teh horizontal lines by rules from the booktabs package. (See third table in my MWE):

enter image description here

\documentclass{article}

\usepackage{array}    % Needed for the second example.
\usepackage{ragged2e} % Needed for the second example.

\usepackage{tabularx} % Needed for the third example.
\usepackage{booktabs} % Needed for the third example.

\begin{document}
\begin{table}[htbp]
\centering
\begin{tabular}{|p{7cm}|c|c|c|} 
\hline
Question & Yes & No & Maybe  \\ 
\hline
As a Coach, would you use this type  of system instead of the traditional 
method?        
&   11   &  2     &    2     \\ 
\hline 
Do you think that this system will  save you time to identify a player's 
position?         & 9     &  2    &  4  \\
\hline
Does the system has any errors/bugs  that interfered during the testing?     
&   3     &  12   &  0 \\
\hline
Do you think the system achieved the  necessary results for your work?    
& 10  &  4   &   1 \\
\hline
Is the System user-friendly to use?        &
14  &  0   &  1  \\
\hline
\end{tabular}
\label{table:3}
\end{table}

\begin{table}[htbp]
\centering
\begin{tabular}{|>{\Centering}m{7cm}|c|c|c|} 
\hline
Question & Yes & No & Maybe  \\ 
\hline
As a Coach, would you use this type \newline of system instead of the traditional 
method?        
&   11   &  2     &    2     \\ 
\hline 
Do you think that this system will \newline save you time to identify a player's 
position?         & 9     &  2    &  4  \\
\hline
Does the system has any errors/bugs  that interfered during the testing?     
&   3     &  12   &  0 \\
\hline
Do you think the system achieved the  necessary results for your work?    
& 10  &  4   &   1 \\
\hline
Is the System user-friendly to use?        &
14  &  0   &  1  \\
\hline
\end{tabular}
\label{table:3}
\end{table}

\begin{table}[htbp]
\centering
\begin{tabularx}{\textwidth}{Xccc} 
\toprule
Question & Yes & No & Maybe  \\ 
\midrule
As a Coach, would you use this type  of system instead of the traditional 
method?        
&   11   &  2     &    2     \\  
Do you think that this system will  save you time to identify a player's 
position?         & 9     &  2    &  4  \\
Does the system has any errors/bugs  that interfered during the testing?     
&   3     &  12   &  0 \\
Do you think the system achieved the  necessary results for your work?    
& 10  &  4   &   1 \\
Is the System user-friendly to use?        &
14  &  0   &  1  \\
\bottomrule
\end{tabularx}
\label{table:3}
\end{table}
\end{document}
2
  • 1
    In the third example i would add \addlinespace between rows in table body. (+1)
    – Zarko
    Commented Jun 3, 2019 at 18:31
  • Works Fine. Used Second Example. Thanks
    – Jhonny
    Commented Jun 4, 2019 at 12:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .