0

enter link description here

Hello guys, I am working on table in latex with little bit problem. I want to remove dash line at yellow circle position in attached image.I am using following codes which are given below.. Please try to solve my issue... Thanks...

{\begin{tabular}{lcc|cc|c} \toprule

 & \multicolumn{1}{l}{Foreign = 119} && {Local =113} && |  \\ \cmidrule{2-6}

& Mean & SD & Mean & SD  &  p\\ \midrule

Total journal articles and scholarly written works & 16.3898 & 9.34069 & 16.4956 & 8.73327 & .929\\

 Beta &  B2 & B2 & B3 & B4 & B5\\

 Gamma & C2 & C2 & C3 & C4 & C5\\ \bottomrule
\end{tabular}}
5
  • 1
    remove the |. Sep 17, 2017 at 14:08
  • But i need | thisone in the table... Sep 17, 2017 at 14:11
  • if you really need a vertical in the header of the last column, make it math: $|$. Sep 17, 2017 at 14:29
  • 1
    @NiamatullahBaloch You're using commands from the package booktabs, so you should have read in its documentation that its author strongly advises against using | in the table definition. A better layout would be to allow linebreaks in the first column, more space between "Foreign …", "Local …" and "p" columns, and a gap in the \cmidrule. Use \begin{tabularx}{\textwidth}{X@{\qquad} cc% @{\quad} >{\quad}l cc %@{\quad} c} \toprule as header (you'll also need \usepackage{tabularx} and close the table with \end{tabularx}) , then replace cmidrule{2-6} with …
    – Andreas
    Sep 17, 2017 at 15:00
  • 1
    @NiamatullahBaloch \cmidrule{2-3}\cmidrule{5-6}. There now is a new (empty) column (between "Foreign …" and "Local …" blocks), so in each line, you must insert & for column 4. Don't you think the table looks much nicer now? :-)
    – Andreas
    Sep 17, 2017 at 15:04

1 Answer 1

2

The problem is the | symbol. Without font proper encoding, this turns into a -.

\documentclass{article}

\usepackage{booktabs}

\begin{document}

{
    \begin{tabular}{lcc|cc|c} 
        \toprule
        & \multicolumn{1}{l}{Foreign = 119} && {Local =113} && \\
        \cmidrule{2-6}
        & Mean & SD & Mean & SD  &  p\\ 
        \midrule
        Total & 16.3898 & 9.34069 & 16.4956 & 8.73327 & .929\\
        Beta &  B2 & B2 & B3 & B4 & B5\\
        Gamma & C2 & C2 & C3 & C4 & C5\\ 
        \bottomrule
    \end{tabular}
}

\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.