0

When I put the code:

\documentclass{article}
\begin{document}
\begin{table}[h]
\begin{center}
\begin{tabular}{|c|c|c|}
\hline
Air & \multicolumn{2}{|c|}{\textit{Oscilations/180s}} \\
\hline
521&521&522\\
\hline
\end{tabular}
\end{center}
\end{table}
\end{document}

I obtain this:

enter image description here

But I would like that the second row, second and third columns, have the same size.

Can anyone help me?

Just another doubt, how can I add a piece of Latex Code in a more estilista way?

Thanks.

Zarko
  • 296,517

1 Answers1

2
  • for the second and third column you had to prescribe the same column width to both, i.e. you should use >{\centering\arraybackslash}{p{<column width>} instead c column type. the sume of both column width had to be larger than width of multicolumn which span this two columns.
  • centering of p{...} column contents you need to load the package array

\documentclass{article}
\usepackage{array}

\begin{document}
\begin{table}[h]
\begin{center}
\begin{tabular}{|c|*{2}{>{\centering\arraybackslash}p{12mm}|}}
\hline
Air & \multicolumn{2}{c|}{\textit{Oscilations/180s}} \\
\hline
521&521&522\\
\hline
\end{tabular}
\end{center}
\end{table}
\end{document}

enter image description here

  • for better code formatting in question you should move code for four spaces to right. this you also can do with help of {} in tool rows above this window.
Zarko
  • 296,517