1

I'm trying to make a marking guidelines table, but when I do, the second column doesn't close and the row lengths keep getting shorter like follows: enter image description here

I've written as follows:

\ProvidesPackage{exam}
\usepackage{amsmath}    
\usepackage{amssymb}    
\usepackage{anyfontsize}
\usepackage{asymptote}  
\usepackage{changepage} 
\usepackage{color}      
\usepackage{enumitem}  
\usepackage{fancyhdr}   
\usepackage{framed}     
\usepackage{geometry}   
\usepackage{graphicx}   
\usepackage{helvet}     
\usepackage{marginnote}
\usepackage{mathptmx}   
\usepackage{multicol}   
\usepackage{multirow}   
\usepackage{pgffor}     
\usepackage{setspace}   
\usepackage{tikz}      
\usepackage{totalcount} 
\usepackage{accents}   
\usepackage{pifont} 
\usepackage{array}
\usepackage{tabulary}
\usepackage{multirow}
\usepackage{booktabs}
\newcommand{\tabitem}{~~\llap{\textbullet}~~}

\begin{center}
\setlength{\extrarowheight}{5pt}
\setlength{\tabcolsep}{10pt}
\begin{tabular}{ |c|c| } 
\hline
\textbf{Criteria} & \textbf{Marks} \\
\hline
 \tabitem Skilfully evaluates the statement with close reference to the prescribed texts\\
 \tabitem Demonstrates a well-informed understanding of context, language, form & 17-20 \\ 
  \hline
 cell5 & cell6 \\ 
 cell8 & cell9 \\ 
\hline
\end{tabular}
\end{center}

How can I get the table to close the gap in the second column when I add extra rows and how can I get the rows to lines up so that the dot points line up as well as center the marks in the second column?

\begin{center}
\setlength{\cellspacetoplimit}{1cm}
\setlength{\cellspacebottomlimit}{1cm}
\begin{tabular}{ |Sl| Sl| } 
\hline
\textbf{Criteria} & \textbf{Marks} \\
\hline
 \tabitem Skilfully evaluates the statement with close reference to the prescribed texts &\\
 \tabitem Demonstrates a well-informed understanding of context, language, form & 17-20 \\ 
  \hline
 cell5 & cell6 \\ 
 cell8 & cell9 \\ 
\hline
\end{tabular}
\end{center}

enter image description here

8
  • Add an ampersand at the end of the first \tabitem text.
    – Bernard
    Commented Sep 28, 2022 at 8:29
  • @Bernard The ambersand closed the line gap, do you know how I could get it so that the dot points line up instead of pyramiding downwards and how to get the marks in second column to be in the middle of the box? Commented Sep 28, 2022 at 8:37
  • you can use the l specifier for the first column in the place of c. For the marks in the second column, do you mean centred vertically?
    – Bernard
    Commented Sep 28, 2022 at 8:41
  • @Bernard Yeah centered vertically so it's not sitting at the bottom of the row Commented Sep 28, 2022 at 8:48
  • The best solution , in my opinion, is to use the cellspace package, which lets you define a minimal vertical spacing at the top and bottom of cells in columns with specifier prefixed with the letter S (or C if you use siunitx). Thus if you choose the same minimal spacing at the top and bottom, it will be vertically centred.
    – Bernard
    Commented Sep 28, 2022 at 9:20

2 Answers 2

1

The package nicematrix helps to solve several issues, with a simpler code.

The environment NiceTabularX allows to keep the table within the text area. \begin{NiceTabularX}{<total width>}{ X ....

\Block{<nro of rows - nro of columns>}{<content>} will center the content in the allocated space ( a 1x1 cell in this example)

As you can see adding a new item will automatically expand the both the left and the right cell while keeping them vertically centered.

cell-space-limits will expand the bottom and top of all cells.

hlines will draw the horizontal lines.

The enumitem package was added for a convenient way to suppress the default left margin of the itemize environment.

a

\documentclass[12pt,a4paper]{article}

\usepackage{nicematrix}
\usepackage{enumitem}

\begin{document}

\noindent\begin{NiceTabularX}{\linewidth}{ X c }[hlines, cell-space-limits=10pt]        
    \Block{1-1}{\bfseries Criteria} & \textbf{Marks} \\     
    \Block{1-1}{%
        \raggedright
        \begin{itemize}[leftmargin=*]
            \item Skilfully evaluates the statement with close reference to the prescribed texts. 
            \item Demonstrates a well-informed understanding of context, language, form.
            \item More items
        \end{itemize}}
            &\Block{1-1}{17--20}\\
    cell5   & cell6 \\ 
    cell8   & cell9 \\      
\end{NiceTabularX}

\end{document}
0
0
  • define columns of p{<width>} (at tabular) or X type (at tabularx`) . Both enable to write multi line text in cells
  • multi line text, as can be concluded from your picture will be simpler write as list (similar as suggested in the @Simon Dispa answer)
  • Using tabukarray package code is relative simple and final result gives already after one compilation:
\documentclass[12pt,a4paper]{article}
\usepackage{tabularray}
\UseTblrLibrary{varwidth}
\usepackage{enumitem}

\begin{document}
    \begin{center}
\begin{tblr}{hlines, vlines,
             colspec = {X[l,m] r},
             rowsep  = 7pt,
             row{1}  = {font=\bfseries},  % <---
             measure = vbox,            % <---
             stretch = -1,         
             }
Criteria    &   Marks   \\
    \begin{itemize}[nosep, leftmargin=*]
\item Skilfully evaluates the statement with close reference to the prescribed texts.
\item Demonstrates a well-informed understanding of context, language, form.
\item More items
    \end{itemize}
            &   17 -- 20    \\
cell 5       &   cell 6     \\
cell 8       &   cell 9     \\
\end{tblr}
    \end{center}
\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 .