0

I would like to be able to change different column widths in different rows i.e. control the cell width in different rows. in the example attached I would like to be able to move the date cell without moving the Email.

` % !TeX program = xelatex
% !TeX spellcheck = en_GB

\documentclass[12pt,addpoints]{exam}
\usepackage{fontspec}% need for arial from top line
\setmainfont{Arial}% needed for arial from top line
\usepackage{array}% this is need to centre data
\renewcommand{\arraystretch}{1.25}
\newcolumntype{C}[1]{>{\centering\arraybackslash}X|} % this centres data
\setlength\arrayrulewidth{1.25pt}% so you can see table boarders at 100%
\usepackage{xcolor}
\usepackage{colortbl}% need to colour table 
\usepackage{parskip}% this stops indent of first line in paragraph

\usepackage{geometry}
\usepackage[shortlabels]{enumitem}
\usepackage{multicol}

\begin{document}
    
 \newgeometry{left=1.5cm,bottom=0.1cm,right=1cm}    
    
    \begin{center}
        
        
        \begingroup
        \renewcommand*{\arraystretch}{1.5}
        \begin{tabular}{|l|p{4cm} |p{1cm} | c |}
            \hline
            \cellcolor{blue!20}Assessment \#  and title & \multicolumn{3}{c|}{} \\
            \hline
            Lecturer name & \multicolumn{3}{c|}{}     \\
            \hline
            Student name    &  \multicolumn{3}{c|}{}          \\
            \hline
            Student ID number   &    \multicolumn{3}{c|}{}   \\
            \hline
            Telephone contact number    &   &  \multicolumn{2}{l|}{Email:}          \\
            \hline
            \multicolumn{4}{|p{\dimexpr\linewidth-2\tabcolsep-2\arrayrulewidth}|}{% 
                \small{ By completing and submitting this signed form to my lecturer, I am stating that :  
                    % \begin{enumerate}[label=(\textbf{\alph*})]
                        \begin{enumerate}[a.]
                            \vspace{-0.3cm}     \item The attached submission is completely my own work
                            \vspace{-0.3cm} \item I have correctly cited all sources of information used in this  work (if required)
                            \vspace{-0.3cm} \item I have kept a copy of this assessment (where practicable )
                            \vspace{-0.3cm}     \item   I understand a copy of my assessment will be kept by **** for their records 
                            \vspace{-0.3cm}     \item   I understand my assessment may be selected for use in the ***** validation and audit process to ensure student assessment meets requirements 
                            \vspace{-0.8cm} 
                        \end{enumerate} 
                }}      \\                                
                \hline
                \cellcolor{blue!20}Student signature    &  &     \cellcolor{blue!20} Date & \\
                \hline
            \end{tabular}
        \end{center}
     \endgroup
     
    \end{document}   

` enter image description here

1 Answer 1

2

Instead of having four columns, you can divide the space into more columns. Then put Email: and Date in the column you like best. For this example, the second table of the figure has 10 columns: the one on the left and nine additional columns of 1 cm width each.

This allows the words to be moved in discrete 1cm steps to the right or left.

The first table was produced with the code of your question.

b

 % !TeX program = xelatex
% !TeX spellcheck = en_GB

\documentclass[12pt,addpoints]{exam}
\usepackage{fontspec}% need for arial from top line
\setmainfont{Arial}% needed for arial from top line
\usepackage{array}% this is need to centre data
\renewcommand{\arraystretch}{1.25}
\newcolumntype{C}[1]{>{\centering\arraybackslash}X|} % this centres data
\setlength\arrayrulewidth{1.25pt}% so you can see table boarders at 100%
\usepackage{xcolor}
\usepackage{colortbl}% need to colour table 
\usepackage{parskip}% this stops indent of first line in paragraph

\usepackage{geometry}
\usepackage[shortlabels]{enumitem}
\usepackage{multicol}

\begin{document}
    
\newgeometry{left=1.5cm,bottom=0.1cm,right=1cm}    


\begingroup
\renewcommand*{\arraystretch}{1.5}
\begin{tabular}{|l|p{4cm} |p{1cm} | c |}
    \hline
    \cellcolor{blue!20}Assessment \#  and title & \multicolumn{3}{c|}{} \\
    \hline
    Lecturer name & \multicolumn{3}{c|}{}     \\
    \hline
    Student name    &  \multicolumn{3}{c|}{}          \\
    \hline
    Student ID number   &    \multicolumn{3}{c|}{}   \\
    \hline
    Telephone contact number    &   &  \multicolumn{2}{l|}{Email:}          \\
    \hline
    \multicolumn{4}{|p{\dimexpr\linewidth-2\tabcolsep-2\arrayrulewidth}|}{% 
        \small{ By completing and submitting this signed form to my lecturer, I am stating that :  
            % \begin{enumerate}[label=(\textbf{\alph*})]
            \begin{enumerate}[a.]
                \vspace{-0.3cm} \item The attached submission is completely my own work
                \vspace{-0.3cm} \item I have correctly cited all sources of information used in this  work (if required)
                \vspace{-0.3cm} \item I have kept a copy of this assessment (where practicable )
                \vspace{-0.3cm} \item   I understand a copy of my assessment will be kept by **** for their records 
                \vspace{-0.3cm} \item   I understand my assessment may be selected for use in the ***** validation and audit process to ensure student assessment meets requirements 
                \vspace{-0.8cm} 
            \end{enumerate} 
    }}      \\                                
    \hline
    \cellcolor{blue!20}Student signature    &  &     \cellcolor{blue!20} Date & \\
    \hline
\end{tabular}
\endgroup

\bigskip

\begingroup
\renewcommand*{\arraystretch}{1.5}
\begin{tabular}{|l| *{9}{p{1cm}}| } 
    \hline
    \cellcolor{red!20}Assessment \#  and title &&& &&& &&&  \\
    \hline
    Lecturer name       &&& &&& &&&  \\
    \hline
    Student name        &&& &&& &&&  \\
    \hline
    Student ID number   &&& &&& &&&  \\
    \hline
    Telephone contact number  &&& &\multicolumn{1}{|l}{Email:}&& &&&  \\
    \hline
    \multicolumn{10}{|p{\dimexpr\linewidth-2\tabcolsep-2\arrayrulewidth}|}{% 
        \small{ By completing and submitting this signed form to my lecturer, I am stating that :       
            \begin{enumerate}[a.]
                \vspace{-0.3cm} \item The attached submission is completely my own work
                \vspace{-0.3cm} \item I have correctly cited all sources of information used in this  work (if required)
                \vspace{-0.3cm} \item I have kept a copy of this assessment (where practicable )
                \vspace{-0.3cm} \item   I understand a copy of my assessment will be kept by **** for their records 
                \vspace{-0.3cm} \item   I understand my assessment may be selected for use in the ***** validation and audit process to ensure student assessment meets requirements 
                \vspace{-0.8cm} 
            \end{enumerate} 
    }}      \\                                
    \hline
    \cellcolor{red!20}Student signature    &&&  &&& &\multicolumn{1}{|l|}{ \cellcolor{green!20} Date}       && \\\hline
    \cellcolor{red!20}Student signature    &&& \multicolumn{1}{|l|}{\cellcolor{gray!20} Date}   &&&         &&& \\\hline
    \cellcolor{red!20}Student signature    &&&  &&& \multicolumn{1}{|l|}{ \cellcolor{blue!20!yellow} Date}  &&& \\
    \hline
\end{tabular}
\endgroup
            
\end{document}  
1
  • Thanks for the quick response, I created 5 columns, after spending over 8 hours playing with the table, but I needed a break to see the 5 columns solution, and had to play with the symbol | to get it in the right place.
    – Jon
    Commented Jul 31, 2022 at 10:37

You must log in to answer this question.

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