我需要创建一个这样的表格:
我写的代码是:
\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{enumitem}
\usepackage{geometry}
\usepackage{times}
\usepackage{multirow}
\thispagestyle{empty}
\usepackage{float}
\geometry{a4paper,total={175mm,280mm},left=15mm,top=10mm}
\begin{document}
\begin{tabular}{|l|c|l|c|c|c|c|c|}\hline
\multirow{2}{*}{Name of the faculty} &\multicolumn{3}{c}{\multirow{2}{*}{Mr KASHYAP}} &\multirow{2}{*}{Department} &\multicolumn{3}{c}{\multirow{2}{*}{ECE}} \\
&\multicolumn{3}{c}{} & &\multicolumn{3}{c}{} \\ \cline{1-1} \cline{2-4} \cline{5-5} \cline{6-8}
Employee Code &---- &Scheme &KTU &Semester &Third &Batch &A \\ \hline
\multirow{2}{*}{Name of the Subject} &\multicolumn{3}{c}{\multirow{2}{*}{Logic Circuit Design}} &\multirow{2}{*}{Subject Code} &\multicolumn{3}{c}{\multirow{2}{*}{EC 207}} \\ \\ \cline{1-1} \cline{2-4} \cline{5-5} \cline{6-8}
Department & \multicolumn{7}{l}{ECE} \\ \hline
\end{tabular}
但它没有给我想要的结果。请帮忙。
答案1
\begin{tabular}{|l|c|l|c|c|c|c|c|}
\hline
Name of the faculty &\multicolumn{3}{c|}{Mr KASHYAP} & Department &\multicolumn{3}{c|}{ECE} \\
\cline{1-1} \cline{2-4} \cline{5-5} \cline{6-8}
Employee Code &---- &Scheme &KTU &Semester &Third &Batch &A \\
\hline
Name of the Subject &\multicolumn{3}{c|}{Logic Circuit Design} &Subject Code &\multicolumn{3}{l|}{EC 207} \\
\cline{1-1} \cline{2-4} \cline{5-5} \cline{6-8}
Department & \multicolumn{7}{l|}{ECE} \\
\hline
\end{tabular}
other codes remain the same. On compilation you get
答案2
使用 ConTeXt 自然表。
\starttext
\startTABLE
\NC Name of the faculty \NC[nx=3] Mr KASHYAP \NC Department \NC[nx=3] ECE \NC\NR
\NC Employee Code \NC --- \NC Scheme \NC KTU \NC Semester \NC Third \NC Batch \NC A \NC\NR
\NC Name of the Subject \NC[nx=3] Logic Circuit Design \NC Subject Code \NC[nx=3] EC 207 \NC\NR
\NC Department \NC[nx=7] ECE \NC\NR
\stopTABLE
\stoptext