Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm using the "calc2latex" macro for OpenOffice Calc to easily create tables. However it doesn't always work perfectly. In this case, I created the following table, but the texts in the two multirows of the fifth column aren't vertically aligned. Do you have an idea how to fix that?

\documentclass{article}
\usepackage{multirow} 

\begin{document}

\begin{table}[htbp]
\caption{}
\begin{tabular}{|c|c|c|c|c|c|}
\hline
\textbf{111} & \textbf{222} & \textbf{333} & \textbf{444} & \textbf{555} & \textbf{666} \\ \hline 
&  &  &  &  &  \\ \hline
aaa & bbb & ccc & ddd & \multicolumn{ 1}{c|}{eee} & fff \\ \cline{ 1- 4}\cline{ 6- 6}
aaa & bbb & ccc & ddd & \multicolumn{ 1}{c|}{} & fff \\ \hline &  &  &  & &  \\ \hline
aaa & bbb & ccc & ddd & \multicolumn{ 1}{c|}{eee} & fff \\ \cline{ 1- 4}\cline{ 6- 6}
aaa & bbb & ccc & ddd & \multicolumn{ 1}{c|}{} & fff \\ \hline
\end{tabular}
\label{}
\end{table}

\end{document}
share|improve this question
    
There is no \multirow in the fifth column, only a \multicolumn, which works horizontally. –  Bernard Aug 3 '14 at 14:16
    
This is a problem of calc2latex which does not implement multirow –  JohnBee May 30 at 11:24

1 Answer 1

up vote 3 down vote accepted

You need \multirow{2}{*}{content} to substitute the \multicolumn environment. Thanks to @Mico.

enter image description here

Code

\documentclass{article}
\usepackage{multirow} 

\begin{document}

\begin{table}[htbp]
\centering
\caption{caption}
\label{}
\begin{tabular}{|c|c|c|c|c|c|}
\hline
\textbf{111} & \textbf{222} & \textbf{333} & \textbf{444} & \textbf{555} & \textbf{666} \\ 
\hline 
&  &  &  &  &  \\ 
\hline
aaa & bbb & ccc & ddd & \multirow{2}{*}{eee} & fff \\ 
\cline{ 1- 4}\cline{ 6- 6}
aaa & bbb & ccc & ddd &  & fff \\ 
\hline 
&  &  &  & &  \\ \hline
aaa & bbb & ccc & ddd & \multirow{2}{*}{eee} & fff \\ 
\cline{ 1- 4}\cline{ 6- 6}
aaa & bbb & ccc & ddd &  & fff \\ 
\hline
\end{tabular}
\end{table}

\end{document}
share|improve this answer
    
It's not necessary to encase the \multirow statements in \multicolumn{1}{c|}{...} statements. Likewise, the \multicolumn{ 1}{c|}{} statements can be replaced with blank space. –  Mico Aug 3 '14 at 14:20
    
@Mico -- Thanks for the comment. Somehow, I learned the skill from here, so kind of addict to it. –  Jesse Aug 3 '14 at 14:30

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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