How to vertically centre a cell spanning multiple rows with the p column type












3















Bit of a mouthful of a question title



I have the following table:



enter image description here



I'm not completely convinced it's the absolute best way to display this information, but I'm reproducing a table that is laid out like this, with a few minor improvements, such as removing ugly vertical lines. I would be open to suggestions as to how I could improve the look though.



Anyway, my question is how to get "Train formation" to be vertically centred.



You can see the problem is that it spans two rows, the permissible speed row and the row underneath. But the row underneath is a p type row consisting of three lines, but not three rows.



I have produced the above image using:



multirow{4}{*}{textbf{Train formation}}


But I'm not too sure whether that takes into account that there aren't actually four rows, there are only two. It's just that the second row is three lines long. I've also set renewcommand{arraystretch}{1.25}



And similarly I wouldn't be sure how to vertically align the two 10 mph (15 kph) entries. As you can see, I have made use of the fact that I happen to have three rows, each of which is two lines long. But If one of those rows were to be only one line long, how would I vertically centre the second and third column?



documentclass[12pt]{article}
pagestyle{plain}
usepackage[margin=1.8cm]{geometry}
geometry{a4paper}
usepackage[parfill]{parskip}

usepackage[detect-weight=true]{siunitx}
DeclareSIUnit{mph}{mph}

usepackage{array}
usepackage{booktabs}
usepackage{multirow}

renewcommand{arraystretch}{1.25}
setlength{tabcolsep}{0.8em}

begin{document}

begin{center}
begin{tabular}{@{}>{raggedrightarraybackslash}p{0.4textwidth}
>{centeringarraybackslash}p{0.15textwidth}
>{centeringarraybackslash}p{0.15textwidth}@{}}
toprule
multicolumn{1}{@{}c}{multirow{4}{*}{textbf{Train formation}}} &
multicolumn{2}{c@{}}{textbf{Permissible speed}} \ cmidrule{2-3}
& textbf{SI{10}{mph} (SI{15}{kilometreperhour}) or above} &
textbf{SI{10}{mph} (SI{15}{kilometreperhour}) or less} \ midrule
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do \
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad &
SI{10}{mph} (SI{15}{kilometreperhour}) &
SI{10}{mph} (SI{15}{kilometreperhour}) \
minim veniam, quis nostrud exercitation ullamco laboris nisi ut \
bottomrule
end{tabular}
end{center}

end{document}









share|improve this question



























    3















    Bit of a mouthful of a question title



    I have the following table:



    enter image description here



    I'm not completely convinced it's the absolute best way to display this information, but I'm reproducing a table that is laid out like this, with a few minor improvements, such as removing ugly vertical lines. I would be open to suggestions as to how I could improve the look though.



    Anyway, my question is how to get "Train formation" to be vertically centred.



    You can see the problem is that it spans two rows, the permissible speed row and the row underneath. But the row underneath is a p type row consisting of three lines, but not three rows.



    I have produced the above image using:



    multirow{4}{*}{textbf{Train formation}}


    But I'm not too sure whether that takes into account that there aren't actually four rows, there are only two. It's just that the second row is three lines long. I've also set renewcommand{arraystretch}{1.25}



    And similarly I wouldn't be sure how to vertically align the two 10 mph (15 kph) entries. As you can see, I have made use of the fact that I happen to have three rows, each of which is two lines long. But If one of those rows were to be only one line long, how would I vertically centre the second and third column?



    documentclass[12pt]{article}
    pagestyle{plain}
    usepackage[margin=1.8cm]{geometry}
    geometry{a4paper}
    usepackage[parfill]{parskip}

    usepackage[detect-weight=true]{siunitx}
    DeclareSIUnit{mph}{mph}

    usepackage{array}
    usepackage{booktabs}
    usepackage{multirow}

    renewcommand{arraystretch}{1.25}
    setlength{tabcolsep}{0.8em}

    begin{document}

    begin{center}
    begin{tabular}{@{}>{raggedrightarraybackslash}p{0.4textwidth}
    >{centeringarraybackslash}p{0.15textwidth}
    >{centeringarraybackslash}p{0.15textwidth}@{}}
    toprule
    multicolumn{1}{@{}c}{multirow{4}{*}{textbf{Train formation}}} &
    multicolumn{2}{c@{}}{textbf{Permissible speed}} \ cmidrule{2-3}
    & textbf{SI{10}{mph} (SI{15}{kilometreperhour}) or above} &
    textbf{SI{10}{mph} (SI{15}{kilometreperhour}) or less} \ midrule
    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do \
    eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad &
    SI{10}{mph} (SI{15}{kilometreperhour}) &
    SI{10}{mph} (SI{15}{kilometreperhour}) \
    minim veniam, quis nostrud exercitation ullamco laboris nisi ut \
    bottomrule
    end{tabular}
    end{center}

    end{document}









    share|improve this question

























      3












      3








      3








      Bit of a mouthful of a question title



      I have the following table:



      enter image description here



      I'm not completely convinced it's the absolute best way to display this information, but I'm reproducing a table that is laid out like this, with a few minor improvements, such as removing ugly vertical lines. I would be open to suggestions as to how I could improve the look though.



      Anyway, my question is how to get "Train formation" to be vertically centred.



      You can see the problem is that it spans two rows, the permissible speed row and the row underneath. But the row underneath is a p type row consisting of three lines, but not three rows.



      I have produced the above image using:



      multirow{4}{*}{textbf{Train formation}}


      But I'm not too sure whether that takes into account that there aren't actually four rows, there are only two. It's just that the second row is three lines long. I've also set renewcommand{arraystretch}{1.25}



      And similarly I wouldn't be sure how to vertically align the two 10 mph (15 kph) entries. As you can see, I have made use of the fact that I happen to have three rows, each of which is two lines long. But If one of those rows were to be only one line long, how would I vertically centre the second and third column?



      documentclass[12pt]{article}
      pagestyle{plain}
      usepackage[margin=1.8cm]{geometry}
      geometry{a4paper}
      usepackage[parfill]{parskip}

      usepackage[detect-weight=true]{siunitx}
      DeclareSIUnit{mph}{mph}

      usepackage{array}
      usepackage{booktabs}
      usepackage{multirow}

      renewcommand{arraystretch}{1.25}
      setlength{tabcolsep}{0.8em}

      begin{document}

      begin{center}
      begin{tabular}{@{}>{raggedrightarraybackslash}p{0.4textwidth}
      >{centeringarraybackslash}p{0.15textwidth}
      >{centeringarraybackslash}p{0.15textwidth}@{}}
      toprule
      multicolumn{1}{@{}c}{multirow{4}{*}{textbf{Train formation}}} &
      multicolumn{2}{c@{}}{textbf{Permissible speed}} \ cmidrule{2-3}
      & textbf{SI{10}{mph} (SI{15}{kilometreperhour}) or above} &
      textbf{SI{10}{mph} (SI{15}{kilometreperhour}) or less} \ midrule
      Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do \
      eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad &
      SI{10}{mph} (SI{15}{kilometreperhour}) &
      SI{10}{mph} (SI{15}{kilometreperhour}) \
      minim veniam, quis nostrud exercitation ullamco laboris nisi ut \
      bottomrule
      end{tabular}
      end{center}

      end{document}









      share|improve this question














      Bit of a mouthful of a question title



      I have the following table:



      enter image description here



      I'm not completely convinced it's the absolute best way to display this information, but I'm reproducing a table that is laid out like this, with a few minor improvements, such as removing ugly vertical lines. I would be open to suggestions as to how I could improve the look though.



      Anyway, my question is how to get "Train formation" to be vertically centred.



      You can see the problem is that it spans two rows, the permissible speed row and the row underneath. But the row underneath is a p type row consisting of three lines, but not three rows.



      I have produced the above image using:



      multirow{4}{*}{textbf{Train formation}}


      But I'm not too sure whether that takes into account that there aren't actually four rows, there are only two. It's just that the second row is three lines long. I've also set renewcommand{arraystretch}{1.25}



      And similarly I wouldn't be sure how to vertically align the two 10 mph (15 kph) entries. As you can see, I have made use of the fact that I happen to have three rows, each of which is two lines long. But If one of those rows were to be only one line long, how would I vertically centre the second and third column?



      documentclass[12pt]{article}
      pagestyle{plain}
      usepackage[margin=1.8cm]{geometry}
      geometry{a4paper}
      usepackage[parfill]{parskip}

      usepackage[detect-weight=true]{siunitx}
      DeclareSIUnit{mph}{mph}

      usepackage{array}
      usepackage{booktabs}
      usepackage{multirow}

      renewcommand{arraystretch}{1.25}
      setlength{tabcolsep}{0.8em}

      begin{document}

      begin{center}
      begin{tabular}{@{}>{raggedrightarraybackslash}p{0.4textwidth}
      >{centeringarraybackslash}p{0.15textwidth}
      >{centeringarraybackslash}p{0.15textwidth}@{}}
      toprule
      multicolumn{1}{@{}c}{multirow{4}{*}{textbf{Train formation}}} &
      multicolumn{2}{c@{}}{textbf{Permissible speed}} \ cmidrule{2-3}
      & textbf{SI{10}{mph} (SI{15}{kilometreperhour}) or above} &
      textbf{SI{10}{mph} (SI{15}{kilometreperhour}) or less} \ midrule
      Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do \
      eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad &
      SI{10}{mph} (SI{15}{kilometreperhour}) &
      SI{10}{mph} (SI{15}{kilometreperhour}) \
      minim veniam, quis nostrud exercitation ullamco laboris nisi ut \
      bottomrule
      end{tabular}
      end{center}

      end{document}






      tables vertical-alignment multirow






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jan 31 at 15:33









      Au101Au101

      7,15832254




      7,15832254






















          2 Answers
          2






          active

          oldest

          votes


















          6














          A slightly improved layout (from my point of view), using a decimal number for the number of ‘rows’ (which are actually lines, as you noticed), and the m{...} specifier in the place of p{...}. I also simplified the code with the km abbreviation and the {=} width argument for multirow.



          documentclass[12pt]{article}
          pagestyle{plain}
          usepackage[margin=1.8cm]{geometry}
          geometry{a4paper}
          usepackage[parfill]{parskip}

          usepackage[detect-weight=true]{siunitx}
          DeclareSIUnit{mph}{mph}

          usepackage{array}
          usepackage{booktabs}
          usepackage{multirow}

          renewcommand{arraystretch}{1.25}
          setlength{tabcolsep}{0.8em}

          begin{document}

          begin{center}
          begin{tabular}{@{}>{raggedrightarraybackslash}m{0.4textwidth}
          >{centeringarraybackslash}m{0.15textwidth}
          >{centeringarraybackslash}m{0.15textwidth}@{}}
          toprule
          multirow{4.5}{=}{centeringtextbf{Train formation}}
          &
          multicolumn{2}{c@{}}{textbf{Permissible speed}} \ cmidrule{2-3}
          & textbf{SI{10}{mph} (SI{15}{kmperhour}) or above} &
          textbf{SI{10}{mph} (SI{15}{kmperhour}) or less} \ midrule
          Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do \
          eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad &
          SI{10}{mph} (SI{15}{kmperhour}) &
          SI{10}{mph} (SI{15}{kmperhour}) \
          minim veniam, quis nostrud exercitation ullamco laboris nisi ut \
          bottomrule
          end{tabular}
          end{center}

          end{document}


          enter image description here






          share|improve this answer


























          • Really nice thanks!

            – Au101
            Jan 31 at 16:17











          • How did you generate the 4.5 value for your multirow? I have a second table, similarly laid out, but with two rows of two lines each (so just get rid of minim veniam, quis nostrud exercitation ullamco laboris nisi ut). Would 2.5 do just as well here?

            – Au101
            Jan 31 at 20:01











          • By trial and error (taking into account the values of aboverule sep and belowrulesep, and the cmidrule thickness).

            – Bernard
            Jan 31 at 20:06











          • okay, thanks for your help!

            – Au101
            Jan 31 at 20:17



















          4














          Since we know the widths of the columns, one can put a tabular inside a tabular and get the columns to align.



          documentclass[12pt]{article}
          pagestyle{plain}
          usepackage[margin=1.8cm]{geometry}
          geometry{a4paper}
          usepackage[parfill]{parskip}

          usepackage[detect-weight=true]{siunitx}
          DeclareSIUnit{mph}{mph}

          usepackage{array}
          usepackage{booktabs}
          usepackage{multirow}

          renewcommand{arraystretch}{1.25}
          setlength{tabcolsep}{0.8em}

          begin{document}

          begin{center}
          begin{tabular}{@{}>{raggedrightarraybackslash}p{0.4textwidth}
          >{centeringarraybackslash}p{0.15textwidth}
          >{centeringarraybackslash}p{0.15textwidth}@{}}
          toprule
          centeringtextbf{Train formation} &
          multicolumn{2}{c@{}}{begin{tabular}{@{}>{centeringarraybackslash}p{0.15textwidth}
          >{centeringarraybackslash}p{0.15textwidth}@{}}
          multicolumn{2}{c@{}}{textbf{Permissible speed}} \ midrule
          textbf{SI{10}{mph} (SI{15}{kilometreperhour}) or above} &
          textbf{SI{10}{mph} (SI{15}{kilometreperhour}) or less}
          end{tabular}} \ midrule
          Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do \
          eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad &
          SI{10}{mph} (SI{15}{kilometreperhour}) &
          SI{10}{mph} (SI{15}{kilometreperhour}) \
          minim veniam, quis nostrud exercitation ullamco laboris nisi ut \
          bottomrule
          end{tabular}
          end{center}

          end{document}


          demo






          share|improve this answer


























          • Ended up using a bit of both answers, thanks!

            – Au101
            Jan 31 at 21:59











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "85"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f472739%2fhow-to-vertically-centre-a-cell-spanning-multiple-rows-with-the-p-column-type%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          6














          A slightly improved layout (from my point of view), using a decimal number for the number of ‘rows’ (which are actually lines, as you noticed), and the m{...} specifier in the place of p{...}. I also simplified the code with the km abbreviation and the {=} width argument for multirow.



          documentclass[12pt]{article}
          pagestyle{plain}
          usepackage[margin=1.8cm]{geometry}
          geometry{a4paper}
          usepackage[parfill]{parskip}

          usepackage[detect-weight=true]{siunitx}
          DeclareSIUnit{mph}{mph}

          usepackage{array}
          usepackage{booktabs}
          usepackage{multirow}

          renewcommand{arraystretch}{1.25}
          setlength{tabcolsep}{0.8em}

          begin{document}

          begin{center}
          begin{tabular}{@{}>{raggedrightarraybackslash}m{0.4textwidth}
          >{centeringarraybackslash}m{0.15textwidth}
          >{centeringarraybackslash}m{0.15textwidth}@{}}
          toprule
          multirow{4.5}{=}{centeringtextbf{Train formation}}
          &
          multicolumn{2}{c@{}}{textbf{Permissible speed}} \ cmidrule{2-3}
          & textbf{SI{10}{mph} (SI{15}{kmperhour}) or above} &
          textbf{SI{10}{mph} (SI{15}{kmperhour}) or less} \ midrule
          Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do \
          eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad &
          SI{10}{mph} (SI{15}{kmperhour}) &
          SI{10}{mph} (SI{15}{kmperhour}) \
          minim veniam, quis nostrud exercitation ullamco laboris nisi ut \
          bottomrule
          end{tabular}
          end{center}

          end{document}


          enter image description here






          share|improve this answer


























          • Really nice thanks!

            – Au101
            Jan 31 at 16:17











          • How did you generate the 4.5 value for your multirow? I have a second table, similarly laid out, but with two rows of two lines each (so just get rid of minim veniam, quis nostrud exercitation ullamco laboris nisi ut). Would 2.5 do just as well here?

            – Au101
            Jan 31 at 20:01











          • By trial and error (taking into account the values of aboverule sep and belowrulesep, and the cmidrule thickness).

            – Bernard
            Jan 31 at 20:06











          • okay, thanks for your help!

            – Au101
            Jan 31 at 20:17
















          6














          A slightly improved layout (from my point of view), using a decimal number for the number of ‘rows’ (which are actually lines, as you noticed), and the m{...} specifier in the place of p{...}. I also simplified the code with the km abbreviation and the {=} width argument for multirow.



          documentclass[12pt]{article}
          pagestyle{plain}
          usepackage[margin=1.8cm]{geometry}
          geometry{a4paper}
          usepackage[parfill]{parskip}

          usepackage[detect-weight=true]{siunitx}
          DeclareSIUnit{mph}{mph}

          usepackage{array}
          usepackage{booktabs}
          usepackage{multirow}

          renewcommand{arraystretch}{1.25}
          setlength{tabcolsep}{0.8em}

          begin{document}

          begin{center}
          begin{tabular}{@{}>{raggedrightarraybackslash}m{0.4textwidth}
          >{centeringarraybackslash}m{0.15textwidth}
          >{centeringarraybackslash}m{0.15textwidth}@{}}
          toprule
          multirow{4.5}{=}{centeringtextbf{Train formation}}
          &
          multicolumn{2}{c@{}}{textbf{Permissible speed}} \ cmidrule{2-3}
          & textbf{SI{10}{mph} (SI{15}{kmperhour}) or above} &
          textbf{SI{10}{mph} (SI{15}{kmperhour}) or less} \ midrule
          Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do \
          eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad &
          SI{10}{mph} (SI{15}{kmperhour}) &
          SI{10}{mph} (SI{15}{kmperhour}) \
          minim veniam, quis nostrud exercitation ullamco laboris nisi ut \
          bottomrule
          end{tabular}
          end{center}

          end{document}


          enter image description here






          share|improve this answer


























          • Really nice thanks!

            – Au101
            Jan 31 at 16:17











          • How did you generate the 4.5 value for your multirow? I have a second table, similarly laid out, but with two rows of two lines each (so just get rid of minim veniam, quis nostrud exercitation ullamco laboris nisi ut). Would 2.5 do just as well here?

            – Au101
            Jan 31 at 20:01











          • By trial and error (taking into account the values of aboverule sep and belowrulesep, and the cmidrule thickness).

            – Bernard
            Jan 31 at 20:06











          • okay, thanks for your help!

            – Au101
            Jan 31 at 20:17














          6












          6








          6







          A slightly improved layout (from my point of view), using a decimal number for the number of ‘rows’ (which are actually lines, as you noticed), and the m{...} specifier in the place of p{...}. I also simplified the code with the km abbreviation and the {=} width argument for multirow.



          documentclass[12pt]{article}
          pagestyle{plain}
          usepackage[margin=1.8cm]{geometry}
          geometry{a4paper}
          usepackage[parfill]{parskip}

          usepackage[detect-weight=true]{siunitx}
          DeclareSIUnit{mph}{mph}

          usepackage{array}
          usepackage{booktabs}
          usepackage{multirow}

          renewcommand{arraystretch}{1.25}
          setlength{tabcolsep}{0.8em}

          begin{document}

          begin{center}
          begin{tabular}{@{}>{raggedrightarraybackslash}m{0.4textwidth}
          >{centeringarraybackslash}m{0.15textwidth}
          >{centeringarraybackslash}m{0.15textwidth}@{}}
          toprule
          multirow{4.5}{=}{centeringtextbf{Train formation}}
          &
          multicolumn{2}{c@{}}{textbf{Permissible speed}} \ cmidrule{2-3}
          & textbf{SI{10}{mph} (SI{15}{kmperhour}) or above} &
          textbf{SI{10}{mph} (SI{15}{kmperhour}) or less} \ midrule
          Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do \
          eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad &
          SI{10}{mph} (SI{15}{kmperhour}) &
          SI{10}{mph} (SI{15}{kmperhour}) \
          minim veniam, quis nostrud exercitation ullamco laboris nisi ut \
          bottomrule
          end{tabular}
          end{center}

          end{document}


          enter image description here






          share|improve this answer















          A slightly improved layout (from my point of view), using a decimal number for the number of ‘rows’ (which are actually lines, as you noticed), and the m{...} specifier in the place of p{...}. I also simplified the code with the km abbreviation and the {=} width argument for multirow.



          documentclass[12pt]{article}
          pagestyle{plain}
          usepackage[margin=1.8cm]{geometry}
          geometry{a4paper}
          usepackage[parfill]{parskip}

          usepackage[detect-weight=true]{siunitx}
          DeclareSIUnit{mph}{mph}

          usepackage{array}
          usepackage{booktabs}
          usepackage{multirow}

          renewcommand{arraystretch}{1.25}
          setlength{tabcolsep}{0.8em}

          begin{document}

          begin{center}
          begin{tabular}{@{}>{raggedrightarraybackslash}m{0.4textwidth}
          >{centeringarraybackslash}m{0.15textwidth}
          >{centeringarraybackslash}m{0.15textwidth}@{}}
          toprule
          multirow{4.5}{=}{centeringtextbf{Train formation}}
          &
          multicolumn{2}{c@{}}{textbf{Permissible speed}} \ cmidrule{2-3}
          & textbf{SI{10}{mph} (SI{15}{kmperhour}) or above} &
          textbf{SI{10}{mph} (SI{15}{kmperhour}) or less} \ midrule
          Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do \
          eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad &
          SI{10}{mph} (SI{15}{kmperhour}) &
          SI{10}{mph} (SI{15}{kmperhour}) \
          minim veniam, quis nostrud exercitation ullamco laboris nisi ut \
          bottomrule
          end{tabular}
          end{center}

          end{document}


          enter image description here







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Jan 31 at 22:01

























          answered Jan 31 at 16:06









          BernardBernard

          171k775202




          171k775202













          • Really nice thanks!

            – Au101
            Jan 31 at 16:17











          • How did you generate the 4.5 value for your multirow? I have a second table, similarly laid out, but with two rows of two lines each (so just get rid of minim veniam, quis nostrud exercitation ullamco laboris nisi ut). Would 2.5 do just as well here?

            – Au101
            Jan 31 at 20:01











          • By trial and error (taking into account the values of aboverule sep and belowrulesep, and the cmidrule thickness).

            – Bernard
            Jan 31 at 20:06











          • okay, thanks for your help!

            – Au101
            Jan 31 at 20:17



















          • Really nice thanks!

            – Au101
            Jan 31 at 16:17











          • How did you generate the 4.5 value for your multirow? I have a second table, similarly laid out, but with two rows of two lines each (so just get rid of minim veniam, quis nostrud exercitation ullamco laboris nisi ut). Would 2.5 do just as well here?

            – Au101
            Jan 31 at 20:01











          • By trial and error (taking into account the values of aboverule sep and belowrulesep, and the cmidrule thickness).

            – Bernard
            Jan 31 at 20:06











          • okay, thanks for your help!

            – Au101
            Jan 31 at 20:17

















          Really nice thanks!

          – Au101
          Jan 31 at 16:17





          Really nice thanks!

          – Au101
          Jan 31 at 16:17













          How did you generate the 4.5 value for your multirow? I have a second table, similarly laid out, but with two rows of two lines each (so just get rid of minim veniam, quis nostrud exercitation ullamco laboris nisi ut). Would 2.5 do just as well here?

          – Au101
          Jan 31 at 20:01





          How did you generate the 4.5 value for your multirow? I have a second table, similarly laid out, but with two rows of two lines each (so just get rid of minim veniam, quis nostrud exercitation ullamco laboris nisi ut). Would 2.5 do just as well here?

          – Au101
          Jan 31 at 20:01













          By trial and error (taking into account the values of aboverule sep and belowrulesep, and the cmidrule thickness).

          – Bernard
          Jan 31 at 20:06





          By trial and error (taking into account the values of aboverule sep and belowrulesep, and the cmidrule thickness).

          – Bernard
          Jan 31 at 20:06













          okay, thanks for your help!

          – Au101
          Jan 31 at 20:17





          okay, thanks for your help!

          – Au101
          Jan 31 at 20:17











          4














          Since we know the widths of the columns, one can put a tabular inside a tabular and get the columns to align.



          documentclass[12pt]{article}
          pagestyle{plain}
          usepackage[margin=1.8cm]{geometry}
          geometry{a4paper}
          usepackage[parfill]{parskip}

          usepackage[detect-weight=true]{siunitx}
          DeclareSIUnit{mph}{mph}

          usepackage{array}
          usepackage{booktabs}
          usepackage{multirow}

          renewcommand{arraystretch}{1.25}
          setlength{tabcolsep}{0.8em}

          begin{document}

          begin{center}
          begin{tabular}{@{}>{raggedrightarraybackslash}p{0.4textwidth}
          >{centeringarraybackslash}p{0.15textwidth}
          >{centeringarraybackslash}p{0.15textwidth}@{}}
          toprule
          centeringtextbf{Train formation} &
          multicolumn{2}{c@{}}{begin{tabular}{@{}>{centeringarraybackslash}p{0.15textwidth}
          >{centeringarraybackslash}p{0.15textwidth}@{}}
          multicolumn{2}{c@{}}{textbf{Permissible speed}} \ midrule
          textbf{SI{10}{mph} (SI{15}{kilometreperhour}) or above} &
          textbf{SI{10}{mph} (SI{15}{kilometreperhour}) or less}
          end{tabular}} \ midrule
          Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do \
          eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad &
          SI{10}{mph} (SI{15}{kilometreperhour}) &
          SI{10}{mph} (SI{15}{kilometreperhour}) \
          minim veniam, quis nostrud exercitation ullamco laboris nisi ut \
          bottomrule
          end{tabular}
          end{center}

          end{document}


          demo






          share|improve this answer


























          • Ended up using a bit of both answers, thanks!

            – Au101
            Jan 31 at 21:59
















          4














          Since we know the widths of the columns, one can put a tabular inside a tabular and get the columns to align.



          documentclass[12pt]{article}
          pagestyle{plain}
          usepackage[margin=1.8cm]{geometry}
          geometry{a4paper}
          usepackage[parfill]{parskip}

          usepackage[detect-weight=true]{siunitx}
          DeclareSIUnit{mph}{mph}

          usepackage{array}
          usepackage{booktabs}
          usepackage{multirow}

          renewcommand{arraystretch}{1.25}
          setlength{tabcolsep}{0.8em}

          begin{document}

          begin{center}
          begin{tabular}{@{}>{raggedrightarraybackslash}p{0.4textwidth}
          >{centeringarraybackslash}p{0.15textwidth}
          >{centeringarraybackslash}p{0.15textwidth}@{}}
          toprule
          centeringtextbf{Train formation} &
          multicolumn{2}{c@{}}{begin{tabular}{@{}>{centeringarraybackslash}p{0.15textwidth}
          >{centeringarraybackslash}p{0.15textwidth}@{}}
          multicolumn{2}{c@{}}{textbf{Permissible speed}} \ midrule
          textbf{SI{10}{mph} (SI{15}{kilometreperhour}) or above} &
          textbf{SI{10}{mph} (SI{15}{kilometreperhour}) or less}
          end{tabular}} \ midrule
          Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do \
          eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad &
          SI{10}{mph} (SI{15}{kilometreperhour}) &
          SI{10}{mph} (SI{15}{kilometreperhour}) \
          minim veniam, quis nostrud exercitation ullamco laboris nisi ut \
          bottomrule
          end{tabular}
          end{center}

          end{document}


          demo






          share|improve this answer


























          • Ended up using a bit of both answers, thanks!

            – Au101
            Jan 31 at 21:59














          4












          4








          4







          Since we know the widths of the columns, one can put a tabular inside a tabular and get the columns to align.



          documentclass[12pt]{article}
          pagestyle{plain}
          usepackage[margin=1.8cm]{geometry}
          geometry{a4paper}
          usepackage[parfill]{parskip}

          usepackage[detect-weight=true]{siunitx}
          DeclareSIUnit{mph}{mph}

          usepackage{array}
          usepackage{booktabs}
          usepackage{multirow}

          renewcommand{arraystretch}{1.25}
          setlength{tabcolsep}{0.8em}

          begin{document}

          begin{center}
          begin{tabular}{@{}>{raggedrightarraybackslash}p{0.4textwidth}
          >{centeringarraybackslash}p{0.15textwidth}
          >{centeringarraybackslash}p{0.15textwidth}@{}}
          toprule
          centeringtextbf{Train formation} &
          multicolumn{2}{c@{}}{begin{tabular}{@{}>{centeringarraybackslash}p{0.15textwidth}
          >{centeringarraybackslash}p{0.15textwidth}@{}}
          multicolumn{2}{c@{}}{textbf{Permissible speed}} \ midrule
          textbf{SI{10}{mph} (SI{15}{kilometreperhour}) or above} &
          textbf{SI{10}{mph} (SI{15}{kilometreperhour}) or less}
          end{tabular}} \ midrule
          Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do \
          eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad &
          SI{10}{mph} (SI{15}{kilometreperhour}) &
          SI{10}{mph} (SI{15}{kilometreperhour}) \
          minim veniam, quis nostrud exercitation ullamco laboris nisi ut \
          bottomrule
          end{tabular}
          end{center}

          end{document}


          demo






          share|improve this answer















          Since we know the widths of the columns, one can put a tabular inside a tabular and get the columns to align.



          documentclass[12pt]{article}
          pagestyle{plain}
          usepackage[margin=1.8cm]{geometry}
          geometry{a4paper}
          usepackage[parfill]{parskip}

          usepackage[detect-weight=true]{siunitx}
          DeclareSIUnit{mph}{mph}

          usepackage{array}
          usepackage{booktabs}
          usepackage{multirow}

          renewcommand{arraystretch}{1.25}
          setlength{tabcolsep}{0.8em}

          begin{document}

          begin{center}
          begin{tabular}{@{}>{raggedrightarraybackslash}p{0.4textwidth}
          >{centeringarraybackslash}p{0.15textwidth}
          >{centeringarraybackslash}p{0.15textwidth}@{}}
          toprule
          centeringtextbf{Train formation} &
          multicolumn{2}{c@{}}{begin{tabular}{@{}>{centeringarraybackslash}p{0.15textwidth}
          >{centeringarraybackslash}p{0.15textwidth}@{}}
          multicolumn{2}{c@{}}{textbf{Permissible speed}} \ midrule
          textbf{SI{10}{mph} (SI{15}{kilometreperhour}) or above} &
          textbf{SI{10}{mph} (SI{15}{kilometreperhour}) or less}
          end{tabular}} \ midrule
          Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do \
          eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad &
          SI{10}{mph} (SI{15}{kilometreperhour}) &
          SI{10}{mph} (SI{15}{kilometreperhour}) \
          minim veniam, quis nostrud exercitation ullamco laboris nisi ut \
          bottomrule
          end{tabular}
          end{center}

          end{document}


          demo







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Jan 31 at 19:26

























          answered Jan 31 at 19:08









          John KormyloJohn Kormylo

          44.6k12568




          44.6k12568













          • Ended up using a bit of both answers, thanks!

            – Au101
            Jan 31 at 21:59



















          • Ended up using a bit of both answers, thanks!

            – Au101
            Jan 31 at 21:59

















          Ended up using a bit of both answers, thanks!

          – Au101
          Jan 31 at 21:59





          Ended up using a bit of both answers, thanks!

          – Au101
          Jan 31 at 21:59


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f472739%2fhow-to-vertically-centre-a-cell-spanning-multiple-rows-with-the-p-column-type%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Probability when a professor distributes a quiz and homework assignment to a class of n students.

          Aardman Animations

          Are they similar matrix