[Tex/LaTex] A table not displayed correctly

tables

I provide two attempts at code to make a table with 4 rows and 5 columns. There are several unexpected features in the tables that are displayed. In both tabular environments, I have \begin{tabular}{|| l | l | l | l | l | l ||} \hline; so I would expect to have 5 vertical lines separating the columns. I only have two vertical lines separating a pair of adjacent columns. I have a double vertical line on the left side of the table but not on the right side. I include code like p{3cm} in each column to specify the width of each column and allow the column header to be typeset on two lines so that the table can fit within the margins. These commands are mostly ignored.

There is one modification that I would like to add to the table. Instead of the numbers in the second column and the check marks in the third, fourth, and fifth columns being displayed along the left edge of each column, I would like them to be centered. I used l because I did want the column headers to be aligned along the left edge of the columns.

\documentclass{amsart}
\usepackage{adjustbox}
\usepackage{mathtools}

\usepackage{makecell}
\usepackage{boldline}
\setcellgapes{3pt}

\begin{document}
\noindent \hspace*{\fill}
\makegapedcells
\begin{tabular}{|| l p{3cm} |  l p{2.5cm} | l p{3cm} | l p{2.5cm} | l p{2cm} | l p{2cm} ||} \hline
\multicolumn{5}{|| c ||}{{\bf Inventory of Clocks and Frequency of Chimes}} \\ \Xhline{0.8pt}
        & Number of clocks  &   Chimes $n$ times on the $n^{\mathrm{th}}$ hour  &   Chimes once on the hour     &   Chimes once on the half-hour \\ \hline
Type A  &   10              &   \checkmark                                               &                               &   \checkmark \\ \hline
Type B  &   5               &   \checkmark                                               &                               &   \\ \hline
Type C  &   3               &                                                   &   \checkmark                           &   \checkmark \\ \hline
\end{tabular}
\hspace{\fill}
\vskip0.25in

\noindent \hspace*{\fill}
\makegapedcells
\begin{tabular}{|| l |  l p{2.5cm} | l p{3cm} | l p{2.5cm} | l p{2cm} | l p{2cm} ||} \hline
\multicolumn{5}{|| c ||}{{\bf Inventory of Clocks and Frequency of Chimes}} \\ \Xhline{0.8pt}
        & Number of clocks  &   Chimes $n$ times on the $n^{\mathrm{th}}$ hour  &   Chimes once on the hour     &   Chimes once on the half-hour \\ \hline
Type A  &   10              &   \checkmark                                               &                               &   \checkmark \\ \hline
Type B  &   5               &   \checkmark                                               &                               &   \\ \hline
Type C  &   3               &                                                   &   \checkmark                           &   \checkmark \\ \hline
\end{tabular}
\hspace{\fill}    

\end{document}

Best Answer

You had specified 12 columns in the preamble, but only supplied 5 columns of data.

enter image description here

\documentclass{amsart}
\usepackage{adjustbox}
\usepackage{mathtools}

\usepackage{array}


\begin{document}
\centering

\setlength\extrarowheight{2pt}
\begin{tabular}{|| p{2cm} |  p{2cm} | p{2cm} | p{2.5cm} | p{2cm} ||} \hline
\multicolumn{5}{|| c ||}{\textbf{Inventory of Clocks and Frequency of Chimes}} \\ \hline
        & Number of clocks  &   Chimes $n$ times on the $n^{\mathrm{th}}$ hour  &   Chimes once on the hour     &   Chimes once on the half-hour \\ \hline
Type A  &   10              &   \checkmark                                               &                               &   \checkmark \\ \hline
Type B  &   5               &   \checkmark                                               &                               &   \\ \hline
Type C  &   3               &                                                   &   \checkmark                           &   \checkmark \\ \hline
\end{tabular}

\bigskip



\end{document}