我希望能够更改不同行中的不同列宽,即控制不同行中的单元格宽度。在所附的示例中,我希望能够移动日期单元格而不移动电子邮件。
` % !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}
答案1
您可以将空间划分为更多列,而不是四列。然后在您最喜欢的列中输入Email:
和Date
。对于此示例,图中的第二个表格有 10 列:左侧的列和另外九列,每列宽度为 1 厘米。
这样就可以将单词以 1cm 的步长向右或向左移动。
第一个表是用你的问题的代码生成的。
% !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}