1

Hi all how i could make this table in latex?? i tried but no luck enter image description here

here is the code i try:

\documentclass[letterpaper]{article}
\usepackage[english]{babel}
\usepackage{color}
\usepackage{array}
\usepackage{supertabular}
\usepackage{hhline}

\begin{document}
\begin{center}
\tablelasttail{}
\begin{supertabular}{m{26.7mm}m{50.53mm}|m{41.66mm}|m{49.01mm}|}
\hline
\multicolumn{1}{|m{26.7mm}|}{{\selectlanguage{english} Main Topic}} &
{\selectlanguage{english} Topic} &
{\selectlanguage{english} Sub Topic} &
{\selectlanguage{english} Publication}\\\hline
\multicolumn{1}{|m{26.7mm}|}{{\selectlanguage{english} A}} &
{\selectlanguage{english} A1} &
~
 &
{\selectlanguage{english} 1}\\\hline
 &
{\selectlanguage{english} A2} &
~
 &
{\selectlanguage{english} 2}\\\hhline{~---}
 &
 &
 &
{\selectlanguage{english} 3}\\\hhline{~~~-}
 &
 &
 &
{\selectlanguage{english} 4}\\\hhline{~~~-}
 &
{\selectlanguage{english} A3} &
{\selectlanguage{english} E1} &
{\selectlanguage{english} 5}\\\hhline{~---}
 &
 &
 &
{\selectlanguage{english} 6}\\\hhline{~~~-}
 &
 &
 &
{\selectlanguage{english} 7}\\\hhline{~~~-}
 &
 &
 &
{\selectlanguage{english} 8}\\\hhline{~~~-}
 &
 &
{\selectlanguage{english} E2} &
{\selectlanguage{english} 9}\\\hhline{~~--}
 &
 &
 &
{\selectlanguage{english} 10}\\\hhline{~~~-}
 &
 &
{\selectlanguage{english} E3} &
{\selectlanguage{english} 11}\\\hhline{~~--}
 &
 &
 &
{\selectlanguage{english} 12}\\\hhline{~~~-}
\multicolumn{1}{|m{26.7mm}|}{{\selectlanguage{english} B}} &
{\selectlanguage{english} B1} &
~
 &
{\selectlanguage{english} 13}\\\hline
 &
{\selectlanguage{english} B2} &
~
 &
{\selectlanguage{english} 14}\\\hhline{~---}
\end{supertabular}
\end{center}
\end{document}
  • 1
    Welcome to TeX.SX! Please show us what you have tried. You will get more help if you post some code showing what you have tried and give a minimal working example. A LaTeX MWE should start with a \documentclass command, have a minimal preamble and then \begin{document}...\end{document}. The example should compile. – Andrew Apr 18 '16 at 4:35
  • 6
  • @Andrew - I've re-opened this posting as I don't think it's a duplicate of Help with multirow table. For instance, the earlier posting did not lend itself at all to an application of \multirow instructions -- despite the presence of the word "multirow" in the posting's title... In contrast, the current posting would be much more tedious to handle without the multirow package. – Mico Apr 18 '16 at 6:31
  • @Mico I didn't vote or suggest to close! I just said it was related:) – Andrew Apr 18 '16 at 7:29
1

Some suggestions:

  • Use \multirow statements for the material that should span 2, 3, 4, 8, or 12 rows.
  • Use \cline instructions, as they're easier to parse than the \hhline directives.
  • Please get rid of all \selectlanguage{english} directives. If you really must, just provide a single \selectlanguage{english} directive immediately before \begin{tabularx}....

enter image description here

\documentclass[letterpaper]{article}
\usepackage[margin=1in]{geometry}  % set page parameters
\usepackage[english]{babel}
\usepackage{color,array,supertabular}
\usepackage{multirow}
\begin{document}
\begin{center}
\setlength\extrarowheight{2pt}
\tablelasttail{}
\begin{supertabular}{|l|p{40mm}|p{40mm}|p{45mm}|}
\hline
Main Topic & Topic & Sub Topic & Publication\\
\hline
\multirow{12}{*}{A} & A1 & & 1 \\
\cline{2-4}
 & \multirow{3}{*}{A2} & & 2 \\
\cline{4-4}
 & & & 3 \\
\cline{4-4}
 & & & 4 \\
\cline{2-4}
 & \multirow{8}{*}{A3} & \multirow{4}{*}{E1}& 5 \\
 \cline{4-4}
 & & & 6 \\
\cline{4-4}
 & & & 7 \\
\cline{4-4}
 & & & 8 \\
\cline{3-4}
 & & \multirow{2}{*}{E2}& 9 \\
\cline{4-4}
 & & & 10 \\
\cline{3-4}
 & & \multirow{2}{*}{E3}& 11 \\
\cline{4-4}
 & & & 12\\
\hline
\multirow{2}{*}{B} & B1 & & 13\\
\cline{2-4}
 & B2 & & 14 \\
\hline
\end{supertabular}
\end{center}
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.