2

I want to create a table in latex in which I have a multicolumn among columns. something like the following:

enter image description here

How can I create it?

1

You can use the package multirow (with the command \multirow{nb of rows}{*}{text}) and the command \multicolumn{nb of columns}{alignment}{text}. The following code make use of this :

\documentclass[11pt]{standalone}
\usepackage{multirow}
\begin{document}
\begin{tabular}{|l|l|l|l|l|}
\hline
\multirow{2}{*}{  } & \multirow{2}{*}{  } &\multicolumn{2}{r|}{  } & \multirow{2}{*}{  }\\\cline{3-4}
&    &    &   &\\\hline
&    &    &   &\\\hline
&    &    &   &\\\hline
&    &    &   &\\\hline
\end{tabular}
\end{document}

which gives

output

  • The table works good but I want it at the center of my page, and when I use the \begin{center} it doesn't work. – user3482383 Jun 18 '15 at 10:00
  • @user3482383 In article class it works for me with \begin{center}. However, it is usually good to put tabular environments inside table environments (as it is often recommended to put a caption below you table). So I'm not sure what doesn't work for you, but first check what class you are using (I put my answer in standalone, as it shows only what was needed here: the tabular. Sorry if it was that that got your error). – Luc M Jun 18 '15 at 17:26
  • @user3482383 I realize you might mean the vertical centre of the page. In that case I recommend you to read the second answer to this question tex.stackexchange.com/questions/2326/… – Luc M Jun 18 '15 at 17:34

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.