3

I need to create a table which looks like this using longtable :

enter image description here

How to create 5th column correctly?

Code which I have right now:

\documentclass[12pt]{article}
\usepackage{dcolumn,longtable,booktabs}
\usepackage[utf8]{inputenc}
\usepackage[russian]{babel} 
\begin{document}

\begin{center}
\begin{longtable}{|l|l|l|l|l|}

\hline \multicolumn{1}{|l|}{\textbf{№}} & \multicolumn{1}{c|}{\textbf{ОПИСАНИЕ ОТКЛОНЕНИЯ}} & \multicolumn{1}{c|}{\textbf{ДЕПАРТАМЕНТ}}  & \multicolumn{1}{c|}{\textbf{ИДЕНТИФИЦИРОВАННЫЙ РИСК} & \multicolumn{1}{c|}{\textbf{НЕ ИДЕНТИФИЦИРОВАННЫЙ РИСК}  }  \\ \hline 
\endfirsthead

\multicolumn{1}{|c|}{\textbf{№}} & \multicolumn{1}{c|}{\textbf{ОПИСАНИЕ ОТКЛОНЕНИЯ}} &
\multicolumn{1}{c|}{\textbf{ДЕПАРТАМЕНТ}} & \multicolumn{1}{c|}{\textbf{ИДЕНТИФИЦИРОВАННЫЙ РИСК} & \multicolumn{1}{c|}{\textbf{НЕ ИДЕНТИФИЦИРОВАННЫЙ РИСК} \\ \hline 
\endhead

\endfoot

\hline \hline
\endlastfoot

1 & ОТКЛОНЕНИЕ 1 & Департамент 1 & Риск 1 & ОПИСАНИЕ НЕ ИДЕНТИФИЦИРОВАННОГО РИСКА \\ 

\end{longtable}
\end{center}

\end{document}
3
  • you want \multicolumn{2} not \multicolumn{1} (not really longtable related, that is a standard latex command) Feb 15, 2016 at 14:31
  • @DavidCarlisle and for vertical merge use \multirow{2} ?
    – Lucky_girl
    Feb 15, 2016 at 14:36
  • Your image shows no vertically merged cells you just want to allow linebreaking in the headers, use a nested table. Feb 15, 2016 at 14:39

1 Answer 1

5

Here is what i obtain (I put some English text due to my lack of expertise in russian) : enter image description here

The code :

\documentclass[12pt]{article}
\usepackage{dcolumn,longtable,booktabs}
\usepackage[utf8]{inputenc}
\usepackage[russian]{babel} 
\begin{document}

\begin{center}
\begin{longtable}{|l|l|l|l|l|l|}

\hline
1 & 2 & 3 & 4 & \multicolumn{2}{c|}{5-6} \\
\hline
text1   & text 2    & text3     & text4     & text5.1 & text6.1 \\
\cline{5-6}
        &           &           &           & Text5.2 & text5.2 \\
\hline        



\end{longtable}
\end{center}

\end{document}

Specifically, you generally want

  • to specify the maximum number of column there is in your table, and then use \multicolumn when needed
  • the command \cline{X-Y} creates a line only between columns X and Y
0

You must log in to answer this question.

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