1

When compiling the table below, I get an extended vertical line before column 1 and after column 1, below my last row. Attached image shows how the table appears in my report. I have no clue why this is happening. Can someone explain me how to remove the extended vertical lines, without removing them in the rest of the table?

\documentclass{report} 

\usepackage{changes}
\usepackage{caption}
\usepackage{subcaption}
\usepackage[justification=centering]{caption}
\usepackage{amssymb}
\usepackage[gen]{eurosym}  %proper euro sign
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage{bm} % for \bm macro
\usepackage[version=4]{mhchem}  %allows chemical formulae
\usepackage{siunitx} %allow SI units
\usepackage{cleveref} %smart referencing, automatic sorting etc.
\usepackage{nomencl}
\usepackage{pdfpages}
\makenomenclature 
\usepackage{tcolorbox}
\usepackage{tabularx}
\usepackage{array}
\usepackage{colortbl}
\usepackage{setspace}
\usepackage{pifont}

\begin{document}   


\begin{table}
    \caption[Characterization techniques per property.]
    {Experimental matrix which shows the used technique to obtain information about a certain material property.}
    \begin{tabular}{|l|l|l|l|l|l|l|l|l|}
    \hline
    \textbf{Property}   & \textbf{ECV}  & \textbf{QSSPC} & \textbf{Sherescan}   & \textbf{PL}   & \textbf{Ellipsometry} & \textbf{SEM}  & \textbf{FTIR}     & \textbf{XRD}  \\ \hline \hiline
    Passivation         & \ding{51}     &                &                      &               &                       &               &                   &               \\ \hline
    Doping profile      &               & \ding{51}      &                      &               &                       &               &                   &               \\ \hline
    Sheet resistance    &               & \ding{51}      & \ding{51}            &               &                       &               &                   &               \\ \hline
    Thickness           & \ding{51}     &                &                      &               & \ding{51}             &\ding{51}      &                   &               \\ \hline
    Crystallinity       &               &                &                      &               &                       &\ding{51}      &                   &\ding{51}      \\ \hline
    Composition         &               &                &                      & \ding{51}     &                       &\ding{51}      &\ding{51}          &               \\ \hline
    Refractive index    &               &                &                      &               & \ding{51}             &               &                   &               \\
    \hline
    \label{tab:experimentmatrix}
    \end{tabular}
\end{table}   

\end{document}

2 Answers 2

2

Put \label{...} outside the tabular environment enclosed by \begin{tabular} and \end{tabular}. At its current position (after the last \hline but before \end{tabular}), LaTeX assumes there is another filled cell in the row after your last \hline and prints the appropriate vertical lines around it.

Since \label refers to \caption, I would propose to have it right after \caption.

\documentclass{report} 

\usepackage[justification=centering]{caption}
\usepackage{pifont}

\begin{document}   
\begin{table}
    \caption[Characterization techniques per property.]
    {Experimental matrix which shows the used technique to obtain information about a certain material property.}
    \label{tab:experimentmatrix}
    \begin{tabular}{|l|l|l|l|l|l|l|l|l|}
    \hline
    \textbf{Property}   & \textbf{ECV}  & \textbf{QSSPC} & \textbf{Sherescan}   & \textbf{PL}   & \textbf{Ellipsometry} & \textbf{SEM}  & \textbf{FTIR}     & \textbf{XRD}  \\ \hline \hline
    Passivation         & \ding{51}     &                &                      &               &                       &               &                   &               \\ \hline
    Doping profile      &               & \ding{51}      &                      &               &                       &               &                   &               \\ \hline
    Sheet resistance    &               & \ding{51}      & \ding{51}            &               &                       &               &                   &               \\ \hline
    Thickness           & \ding{51}     &                &                      &               & \ding{51}             &\ding{51}      &                   &               \\ \hline
    Crystallinity       &               &                &                      &               &                       &\ding{51}      &                   &\ding{51}      \\ \hline
    Composition         &               &                &                      & \ding{51}     &                       &\ding{51}      &\ding{51}          &               \\ \hline
    Refractive index    &               &                &                      &               & \ding{51}             &               &                   &               \\
    \hline
    \end{tabular}
\end{table}   
\end{document}

enter image description here

2
  • \label actually refers to \caption, so its place is nearer (but after) it or inside the argument to it.
    – egreg
    May 3, 2018 at 12:50
  • @egreg: True. I changed the answer accordingly.
    – Tiuri
    May 3, 2018 at 12:53
2

mostly of topic ... your table is to wide for fit it in text width. as solution can be

  • use tabularx for table environemt
  • rotate column headers

\documentclass{report}

\usepackage{changes}
\usepackage{caption}
\usepackage{subcaption}
\usepackage[justification=centering]{caption}
\usepackage{amssymb}
\usepackage[gen]{eurosym}  %proper euro sign
%\usepackage{amsmath} loaded by mathtools
\usepackage{mathtools}
\usepackage{bm} % for \bm macro
\usepackage[version=4]{mhchem}  %allows chemical formulae
\usepackage{siunitx} %allow SI units
\usepackage{cleveref} %smart referencing, automatic sorting etc.
\usepackage{nomencl}
\usepackage{pdfpages}
\makenomenclature
\usepackage{tcolorbox}
\usepackage{rotating} % added
\usepackage{makecell, % added
            tabularx}
\renewcommand\theadfont{\small\bfseries}
%\usepackage{array} loaded by tabularx
\usepackage{colortbl}
\usepackage{setspace}
\usepackage{pifont}

%---------------- show page layout. don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%

\begin{document}
    \begin{table}
    \settowidth\rotheadsize{\theadfont Ellipsometry}
\caption[Characterization techniques per property.]
        {Experimental matrix which shows the used technique to obtain information about a certain material property.}
    \label{tab:experimentmatrix}
    \begin{tabularx}{\linewidth}{
                    |l|
              *{8}{>{\centering\arraybackslash}X|}
                                }
    \hline
\thead{Property}    & \rothead{ECV} & \rothead{QSSPC}       & \rothead{Sherescan}
                    & \rothead{PL}  & \rothead{Ellipsometry}& \rothead{SEM}
                    & \rothead{FTIR}& \rothead{XRD}         \\
    \hline\hline
Passivation         & \ding{51}     &                       &
                    &               &                       &
                    &               &                       \\
    \hline
Doping profile      &               & \ding{51}             &
                    &               &                       &
                    &               &                       \\
    \hline
Sheet resistance    &               & \ding{51}             & \ding{51}
                    &               &                       &
                    &               &                       \\
    \hline
Thickness           & \ding{51}     &                       &
                    &               & \ding{51}             & \ding{51}
                    &               &                       \\
    \hline
Crystallinity       &               &                       &
                    &               &                       & \ding{51}
                    &               & \ding{51}             \\
    \hline
Composition         &               &                       &
                    & \ding{51}     &                       & \ding{51}
                    & \ding{51}     &                       \\
    \hline
Refractive index    &               &                       &
                    &               & \ding{51}             &
                    &               &                       \\
    \hline
\end{tabularx}
    \end{table}
\end{document}

enter image description here

You must log in to answer this question.

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