1

Why is my table missing a little bit of its vertical rule near the top/right (just below where it says "Sets")?

Context:

  1. I'm making fractions worksheets for students, many of whom will have diverse special needs. This makes the vertical rules necessary as it defines where there pencil strokes should go and not go.
  2. I got all the `\paddingtop' stuff from this thread. I do not really understand it, but it has worked well in other documents.

MWE:

\documentclass[12pt,letterpaper]{article}

\usepackage[left=1.52cm,right=1.5cm,top=2cm,bottom=2cm]{geometry}

\usepackage{tabularx}
\newcolumntype{C}[1]{>{\centering\arraybackslash}m{#1}}
\newcolumntype{Y}{>{\centering\arraybackslash}X}

\usepackage{lscape}

\usepackage{cellspace}
\setlength\cellspacetoplimit{20pt}
\setlength\cellspacebottomlimit{4pt}
\addparagraphcolumntypes{X}

% To create the the paddingtop part... which I don't totally understand.
\makeatletter
\newsavebox\saved@arstrutbox
\newcommand*{\setarstrut}[1]{%
  \noalign{%
    \begingroup
      \global\setbox\saved@arstrutbox\copy\@arstrutbox
      \global\setbox\@arstrutbox\hbox{%
        \vrule \@height #1
               \@depth  0cm
               \@width\z@
      }%
    \endgroup
  }%
}
\newcommand*{\restorearstrut}{%
  \noalign{%
    \global\setbox\@arstrutbox\copy\saved@arstrutbox
  }%
}
\makeatother

\newcommand{\paddingtop}[2]{\setarstrut{#1} #2 \\ \restorearstrut}

\begin{document}

\begin{landscape}

\begin{tabularx}{24cm}{|C{3cm}|C{2.5cm}|C{7cm}|C{5cm}|Y|} \hline
Words & Symbols & Point \& Length on Number Line & Areas & Sets \\ \hline
\paddingtop{0.5cm}{&&&}
Three Halves or one and a half &&&& \\ [1cm]\hline
\end{tabularx}

\end{landscape}

\end{document}
2

You need another ampersand in the argument to \paddingtop:

\paddingtop{0.5cm}{&&&&}

entire rule

| improve this answer | |
  • Seriously, that's it? Oh man... I'm pretty new to code and LaTeX and all that stuff... Any tips for helping me catch that type of mistake? – WeCanLearnAnything Aug 11 '15 at 23:54
  • @WeCanLearnAnything Not sure really. I just know that when bits of vertical rules are missing in tables, there are 2 common causes: either there are fewer columns in the row than columns in the table, or there's a \multicolumn which forgets to specify that the rule should be used before/after. Don't know if that helps. – cfr Aug 11 '15 at 23:58

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.