0

People help. There is a table, I can not even in the center (vertically and horizontally) Field: Check item, Note, Not cheked, Supply Voltage - They're not in the middle (horizontal) A Note and Check item and should be centered vertically align

[Code][1]

\begin{small}
\begin{longtable}{|M{25mm}|M{17mm}|M{17mm}|M{22mm}|M{20mm}|M{20mm}|M{22mm}|}  

\hline
\multirow{3}{25mm}{  Check item}                      & 
\multicolumn{2}{M{34mm}|}{ Device \mbox{IMEI.123456.12345}}       & 
\multicolumn{3}{M{62mm}|}{ XXX}               & 
\multirow{3}{22mm}{ Note} \\ \cline{2-6}                  &                           

\multirow{2}{15mm}{  norm}                                    & 
\multirow{2}{17mm}{  item number technique}                   & 
\multicolumn{1}{M{22mm}|}{ normal conditions}                 & 
\multicolumn{1}{M{20mm}|}{ plus 50 °С}                        & 
\multicolumn{1}{M{20mm}|}{ minus 20 °С}                           & 
\\ \cline{4-6}

&&& \multicolumn{3}{M{62mm}|}{  Supply voltage}  &
\\ \cline{4-6}
&&& \multicolumn{1}{M{22mm}|}{ 2,2 V}                         &
\multicolumn{1}{M{20mm}|}{ 5 V}                                   & 
\multicolumn{1}{M{20mm}|}{ 5 V}                                   & 
\\ \cline{1-7}
\endfirsthead

\endhead
\multicolumn{1}{|M{25mm}|}{ 1 Operability RS-232C} &
\multicolumn{1}{M{17mm}|}{Compliant}                         &
\multicolumn{1}{M{17mm}|}{5.2.1}                         &&  
\multicolumn{2}{M{40mm}|}{\multirow{2}*{not checked}} &
\\ \cline{1-4} \cline{7-7} 

\multicolumn{1}{|M{25mm}|}{ 2 Operability RS-485}  &
\multicolumn{1}{M{17mm}|}{Compliant}                        &
\multicolumn{1}{M{17mm}|}{5.2.2.1}                       &&   
\multicolumn{2}{M{40mm}|}{}                              &
\\ \hline

\multicolumn{1}{|M{25mm}|}{ 3 Operability Ethernet} &
\multicolumn{1}{M{17mm}|}{Compliant}                         &
\multicolumn{1}{M{17mm}|}{5.2.2.2}                        &&&&
\\ \hline

\end{longtable}
\end{small}

Thank you very much! I like you very much cleared up! M {} I used array package, to center the word in the cell. This is not true? I take into account your recommendations. And I turned on the one hand, and on the other - not very. "Check item", "norm", "item number", "Note" moved to the left, "XXX" and "Compliant" went up.

\newcolumntype{L}[1]{>{\raggedright\arraybackslash}p{#1}}
\newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}}
\newcolumntype{R}[1]{>{\raggedleft\arraybackslash}p{#1}}
\newcolumntype{P}[1]{>{\centering\arraybackslash}p{#1}}
\newcolumntype{M}[1]{>{\centering\arraybackslash}m{#1}}


\begin{small}
\begin{longtable}{|C{25mm}|C{17mm}|C{17mm}|C{22mm}|C{20mm}|C{20mm}|C{22mm}|}  

\hline
\multirow{6}{25mm}{Check item}                                & 
\multicolumn{2}{C{34mm}|}{ Device \mbox{IMEI.123456.12345}}   & 
\multicolumn{3}{C{62mm}|}{ XXX}                               & 
\multirow{6}{22mm}{ Note} \\ \cline{2-6}                      &                           

\multirow{4}{15mm}{  norm}                                    & 
\multirow{4}{17mm}{  item number technique}                   & 
{ normal conditions}                                          & 
{ plus 50 °С}                                                 & 
{ minus 20 °С}                                                & 
\\ \cline{4-6}

&&& \multicolumn{3}{C{62mm}|}{Supply voltage}   &
\\ \cline{4-6}
&&                                              & 
{ 2,2 V}                                        &
{ 5 V}                                          & 
{ 5 V}                                          & 
\\ \cline{1-7}
\endfirsthead
\endhead

{ 1 Operability RS-232C}                              &
{Compliant}                                           &
{5.2.1}                                               &&  
\multicolumn{2}{C{40mm}|}{\multirow{4}*{not checked}} &
\\ \cline{1-4} \cline{7-7} 


{ 2 Operability RS-485}                               &
{Compliant}                                           &
{5.2.2.1}                                             &&   
\multicolumn{2}{C{40mm}|}{}                           &
\\ \hline

{ 3 Operability Ethernet}                             &
{Compliant}                                           &
{5.2.2.2}                                             &&&&
\\ \hline


\end{longtable}
\end{small}

\begin{longtable}{|M{25mm}|C{17mm}|C{17mm}|C{22mm}|C{20mm}|C{20mm}|C{22mm}|}  
\hline
\multirow{6}*{ Check item}                                    & 
\multicolumn{2}{M{34mm}|}{ Device \mbox{IMEI.123456.12345}}   & 
\multicolumn{3}{C{62mm}|}{ \centering XXX}                    & 
\multirow{6}*{Note} \\ \cline{2-6}            &                           
\multirow{3}*{norm}                                           & 
\multirow{3}{17mm}{ \centering item number technique}         & 
\multicolumn{1}{M{20mm}|}{ normal conditions}                                         & 
{ plus 50 °С}                                                 & 
{ minus 20 °С}                                                & 
\\ \cline{4-6}
&&& \multicolumn{3}{C{62mm}|}{\centering Supply voltage}   &
\\ \cline{4-6}
&&                                              & 
{ 2,2 V}                                        &
{ 5 V}                                          & 
{ 5 V}                                          & 
\\ \cline{1-7}
\endfirsthead
\endhead
{ 1 Operability RS-232C}                              &
{Compliant}                                           &
{5.2.1}                                               &&  
\multicolumn{2}{P{40mm}|}{\multirow{3}*{\centering not checked}} &
\\ \cline{1-4} \cline{7-7} 
{ 2 Operability RS-485}                               &
{Compliant}                                           &
{5.2.2.1}                                             &&   
\multicolumn{2}{P{40mm}|}{}                           &
\\ \hline
{ 3 Operability Ethernet}                             &
{Compliant}                                           &
{5.2.2.2}                                             &&&&
\\ \hline
\end{longtable}
\end{small}
\clearpage
\SetEmptyPage
\end{document}

He made another small table. And here's what happens: The combined row is not aligned to the center, and moved to the left. Where am I wrong?

\begin{longtable}{|C{40mm}|C{40mm}|C{40mm}|C{40mm}|}
\caption{ } \label{instr:3} \\
\hline
\multicolumn{1}{|p{40mm}|}{Name of a power-supply circuit} &
\multicolumn{1}{p{40mm}|}{Power-supply circuit tension} &
\multicolumn{1}{p{40mm}|}{Current of consumption of a cell, А} & 
\multicolumn{1}{p{40mm}|}{ Restriction on current, А}       \\\hline
\endfirsthead
\multicolumn{4}{|p{160mm}|}
{\centering {Source PU1}} \\ \hline
<<5Ва>> & 5 В & 1 & 2 \\ \hline
<<5В>>  & 5 В & 1 & 2 \\ \hline
\multicolumn{4}{|p{160mm}|}   {\centering{Source PU2}} \\ \hline
<<2,7В>> & 2,2 & 1,2 & 2,2 \\ \hline
\end{longtable}
1
  • 2
    Please insert the code to your question. I am not going to open external links. Thank you.
    – LaRiFaRi
    Nov 28, 2016 at 13:54

1 Answer 1

1

Your file is incomplete, so I had to make some guesses. I guessed that M{...} is an m{...} column.

Let's take the "Check item" as an example. Although it should span 3 logical rows, if you look at the output you will see that it occupies 6 physical rows. As multirow doesn't know how tall your rows are, you have to specify \multirow{6} to get it vertically centered.

NOTE: You have a lot of specs like \multicolumn{1}{|M{25mm}|} in a column that already has |M{25mm}| as its specification. This makes no sense, it just makes the table more complicated. As for the horizontal centering, there are two ways. (1) add \centering.

\multirow{6}{25mm}{\centering Check item}

(By the way, if you have a recent version of multirow (version 2.0 or higher) you don't have to repeat the 25mm but you can write =) (2) Put it in a c column:

\multicolumn{1}{|c|}{\multirow{6}{*}{Check item}} 

You can do the same for the other entries, just count how many physical rows there are in each case.

With the "not checked" entry there is another problem, even when you make it

\multirow{4}*{not checked}}

The problem is, the reference point in that row is the second line of the first cell in that row, because you have used m{...} columns. This means the baseline (reference point) of the row is the last line. If you count from this line there are only 3 physical rows. so you need

\multirow{3}*{not checked}}

I have no idea why you want to use m{...} columns; often this is done because its function is misunderstood. I would advise to use p{...} columns and go for \multirow{4}. And to get horizontal centering:

\multicolumn{2}{c|}{\multirow{4}*{not checked}}

The \centering command doesn't work with * as width specifier; you would have to give the actual width, or = with a recent multirow.

11
  • Thank you very much! I like you very much cleared up! M {} I used array package, to center the word in the cell. This is not true? I take into account your recommendations. And I turned on the one hand, and on the other - not very. "Check item", "norm", "item number", "Note" moved to the left, "XXX" and "Compliant" went up.
    – Skandalli
    Nov 29, 2016 at 6:59
  • Use \multirow{6}{*}{Check item} , \multirow{4}{*}{norm} \multirow{4}{17mm}{\centering item number technique}, \multirow{6}{*}{ Note}. Compliant can be moved by changing the first column specifier to M{25mm}. And XXX can be moved by changing the entry to the left of it to \multicolumn{2}{M{34mm}|}{Device \mbox{IMEI.123456.12345}}. Nov 29, 2016 at 9:05
  • I just saw that changing the first column to M moves "not checked. Compensate it with \multicolumn{2}{C{40mm}|}{\multirow{3}*{not checked}}. Nov 29, 2016 at 9:09
  • Thanks a lot for your help! Three days of searching for the cause. Do I understand correctly that if a word is short, the multirow {x} *, and if a few lines, the multirow {x} {25mm}? And this time - Device, XXX and Supply Voltage visually shifted to the left? This is due to what?
    – Skandalli
    Nov 29, 2016 at 10:51
  • And yet, if I change the Device Type M, then why change and XXX? It's different cell? How are they related?
    – Skandalli
    Nov 29, 2016 at 10:57

You must log in to answer this question.

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