-2

I want to create the table as shown in the Image. enter image description here

  • What did you try? – Bernard Jun 25 '18 at 17:40
  • 1
    You might want to have a look at the \multicolumn command. – leandriis Jun 25 '18 at 18:08
  • @Bernard nothing because I have no idea how to do it. – Kunal Tiwari Jun 25 '18 at 18:14
  • @leandriis I did have a look (at \multicolumn). But did not get anything over there. Its sad that something that can be done so easily in Word becomes pain in LaTeX. – Kunal Tiwari Jun 25 '18 at 18:16
  • 2
    Well, the multicolumn command in its general form looks like: \multicolumn{<number of columns>}{<format>}{<text>}. Applied to your table, it would for example be \multicolumn{6}{|l|}{\textbf{Core Courses}}. Apart from that, please edit your question to include the code for the table you already have. With the code it is a lot easier to see where your actual problem is. – leandriis Jun 25 '18 at 18:32

1 Answers1

5

Here is a possible code, based on tabularx and makecell:

\documentclass{article}

\usepackage{tabularx, ragged2e, makecell}

\begin{document}

\begin{table}[!htb]
\sffamily
\setlength{\extrarowheight}{2pt}
\renewcommand{\theadfont}{\normalsize\bfseries}
\begin{tabularx}{\linewidth}{!{\vrule width0.8pt}c|c|>{\arraybackslash\RaggedRight}X|c|c|c!{\vrule width0.8pt}}
    \Xhline{0.8pt}
  \thead{S. No}& \thead{Course\\No} & \thead{Course Title} & thead{Sem/Year} & \thead{Credit} & \thead{Grade}\\
    \Xhline{0.8pt}
    \multicolumn{6}{!{\vrule width0.8pt}l!{\vrule width0.8pt}}{\bfseries Core Courses}\\
    \Xhline{0.8pt}
     & & & & & \\ \hline
     & & & & & \\ \hline
     & & & & & \\ \hline
     & & & & & \\ \hline
     & & & & & \\ \hline
     & & & & & \\ \hline
     & & & & & \\ \hline
     & & & & & \\
    \Xhline{0.8pt}
    \multicolumn{6}{!{\vrule width0.8pt}l!{\vrule width0.8pt}}{\bfseries Elective Courses}\\
    \Xhline{0.8pt}
     & & & & & \\ \hline
     & & & & & \\ \hline
     & & & & & \\ \hline
     & & & & & \\ \hline
     & & & & & \\ \hline
     & & & & & \\
    \Xhline{0.8pt}
    \multicolumn{6}{!{\vrule width0.8pt}l!{\vrule width0.8pt}}{\bfseries Compulsory Courses / Optional Courses}\\
    \Xhline{0.8pt}
     & & & & & \\ \hline
     & & & & & \\ \hline
     & & & & & \\ \hline
     & & & & & \\
    \Xhline{0.8pt}
    \end{tabularx}
\end{table}

\end{document} 

enter image description here

Bernard
  • 271,350