I'm trying to have get a background color at my tables consisting of both multirows and multicolums. Without any color, the table works fine. But what I want to color expands over variable amounts of rows. I've tried to color four rows with the same color, with one cell stretching over four rows and one cell stretching over two rows.

But if I do that the second coloring, applies the color on top of the multirow text. table wouthout color

table with text

As you can see, the second line of rowcolor removes the upper part of 'Grade' from cell 1 and third row color removed the lower part of 'Grade' and lower part of Thickness. Any solution ideas?

my tex:

\multirow{4}{*}{Grades}&Yield&\multicolumn{3}{c|}{Impact bending test}\\
                      &Strength&\multirow{2}{*}{Thickness}&Test& Impact\\
                             &$\mathbf{R_e[N/mm^2]}$&                                &{\bf temperature}     & {\bf work}\\
                             &\bf{transv.min.}      &\bf{ transv.}                   &$\mathbf{[\grader]}$  & {\bf [J]} \\\hline
\multirow{ 1}{*}{{\bf DH36}}   &     & {\bf 5.5 – 7.0} & {\bf         -40} & {\bf       24} \\

  • the - in \multirow{-2}{*}{ } doesnt work for me.. it just moves the text outside the table – onmikkelsen Nov 14 '16 at 18:43
  • 1
    Please, extend your code sniped to complete document starting with \documentclass{...}, with necessary packages and your new commands definitions and ending with end{document}. In present state it is not possible to compile. Welcome to site! – Zarko Nov 14 '16 at 19:09

Based on guessing about your preamble and meaning of used commands:

enter image description here


                &   &   \multicolumn{3}{c|}{\textbf{Impact bending test}}    \\
        &   \multirow{-3}*[-1ex]{\makecell{Yield\\  Strength\\ 
                                            {$\mathbf{R_e[\si{N\per\milli\meter^2}]}$} \\transv. min.}}
                    &   \makecell{Thickness\\  transv.}    
                        &   \makecell{Test\\ temperature\\ \si{\celsius}}
                            &   \makecell{Impact\\ work\\ \si{J} }          \\
DH36   &       & 5.5 – 7.0 & -40   & 24    \\

Edit: macro makecell have options ˙bfor bottom position,tfor top position,lfor left aligned cell content andr` for right aligned. Use of it without options the cell content is vertically and horizontally centered.

If in above MWE replace the second row of table with

        &   \multirow{-3}*[3pt]{\makecell{Yield\\  Strength\\
                                            {$\mathbf{R_e[\si{N\per\milli\meter^2}]}$} \\transv. min.}}
                    &   \makecell[b]{Thickness\\  transv.}
                        &   \makecell[b]{Test\\ temperature\\ \si{\celsius}}
                            &   \makecell[b]{Impact\\ work\\ \si{J} }          \\

than the table is as follows:

enter image description here

| improve this answer | |
  • Probably, you should use [detect-weight=true]. – Bernard Nov 14 '16 at 20:30
  • @Bernard, yes, this is right key for siunitx, I consider this in edited answer – Zarko Nov 14 '16 at 20:38

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.