Vertical centering with multirow and tables The Next CEO of Stack OverflowVertical centering...

Does the Idaho Potato Commission associate potato skins with healthy eating?

What happens if you break a law in another country outside of that country?

logical reads on global temp table, but not on session-level temp table

What difference does it make matching a word with/without a trailing whitespace?

Prodigo = pro + ago?

How do I secure a TV wall mount?

Is it reasonable to ask other researchers to send me their previous grant applications?

Does Germany produce more waste than the US?

Calculate the Mean mean of two numbers

Why do we say “un seul M” and not “une seule M” even though M is a “consonne”?

It it possible to avoid kiwi.com's automatic online check-in and instead do it manually by yourself?

Is it okay to majorly distort historical facts while writing a fiction story?

Physiological effects of huge anime eyes

My boss doesn't want me to have a side project

How to unfasten electrical subpanel attached with ramset

Is it a bad idea to plug the other end of ESD strap to wall ground?

Is it correct to say moon starry nights?

Is a linearly independent set whose span is dense a Schauder basis?

Creating a script with console commands

How does a dynamic QR code work?

Incomplete cube

Horror film about a man brought out of cryogenic suspension without a soul, around 1990

Avoiding the "not like other girls" trope?

Planeswalker Ability and Death Timing



Vertical centering with multirow and tables



The Next CEO of Stack OverflowVertical centering in multirow table cellsColor and rules in tables with multirowVertical alignment in tables without multirowNot vertical centering in multirow at newlineVertical centering with multirowTable with multirow vertical arrow and textHelp with tables and multirowTop Vertical Alignment with MultirowCentering columns in xtabular with multicolumn and multirowVertical Centering in Tables












0















I am trying to figure something out that I can't find the answer to.



I am trying to create a table where some cells in a row need to have multiple rows. I thought "multirow" would allow me to do this, which it does, but it incorrectly vertically centers the data that spans multiple rows. See the attached figure - it ends up being too high.enter image description here



I realize that in the example I sent, I can just use 3 rows with the top and bottom being empty but in the case of having an even number of split rows, that method isn't possible. I also looked at the documentation for multirow and they specify that there is a finetuning parameter where you can adjust its height manually. I do not want to do this because if I am off even by a little bit it won't line up. Plus I figured there would be a better way.



Here is a MWE



documentclass[12pt,a4paper,twoside]{report}
%usepackage[latin1]{inputenc} % shouldn't you be using 'utf8'?
usepackage{amsmath}
%%%usepackage{amsfonts} % is loaded automatically by 'amssymb'
usepackage{amssymb}
usepackage{graphicx}

usepackage{multirow}
usepackage{array}
newcolumntype{M}[1]{>{centeringarraybackslash}m{#1textwidth}}

setlength{textheight}{9in} % Height of the main body of the text
setlength{topmargin}{-.5in} % .5" margin on top of page
setlength{headsep}{.5in} % space between header and top of body
addtolength{headsep}{-headheight} % See The LaTeX Companion, p 85
setlength{footskip}{.5in} % space between footer and bottom of body
setlength{textwidth}{6.25in} % width of the body of the text
setlength{oddsidemargin}{.25in} % 1.25" margin on the left for odd pages
setlength{evensidemargin}{0in} % 1.25" margin on the right for even pages

% Marginal notes
setlength{marginparwidth}{.75in} % width of marginal notes
setlength{marginparsep}{.125in} % space between marginal notes and text
usepackage{booktabs}

begin{document}
begin{table}[ht]
renewcommand{arraystretch}{1.5}
setlengthtabcolsep{0pt}
caption[A caption]{A caption}
label{tab-brachy-review}
footnotesize
begin{tabular*}{textwidth}{@{extracolsep{fill}}%
M{0.1}M{0.14}M{0.13}M{0.15}M{0.13}M{0.14}M{0.085}M{0.125}}

Refs & Site & Method & Sample Size & fractions & Delay (days) & BF and Perm & test \ midrule
Janssen & Te & 1 & 23 & 25 / 5 & Day 5textsuperscript{a} & Increase & NSC \ midrule
multirow{3}{*}{Coolens} & multirow{3}{*}{Li} & multirow{3}{*}{2} & multirow{3}{*}{6} & multirow{3}{*}{30-54 / 6} & Day 3textsuperscript{a} & Increase & Increase \ cmidrule{6-8}
& & & & & 30 & Decrease & NSC \ cmidrule{6-8}
& & & & & 60 & Decrease & NSC \ cmidrule{6-8}
Janssen & Te & 1 & 23 & 25 / 5 & Day 5textsuperscript{a} & Increase & NSC \ bottomrule
end{tabular*}
end{table}
end{document}








share



























    0















    I am trying to figure something out that I can't find the answer to.



    I am trying to create a table where some cells in a row need to have multiple rows. I thought "multirow" would allow me to do this, which it does, but it incorrectly vertically centers the data that spans multiple rows. See the attached figure - it ends up being too high.enter image description here



    I realize that in the example I sent, I can just use 3 rows with the top and bottom being empty but in the case of having an even number of split rows, that method isn't possible. I also looked at the documentation for multirow and they specify that there is a finetuning parameter where you can adjust its height manually. I do not want to do this because if I am off even by a little bit it won't line up. Plus I figured there would be a better way.



    Here is a MWE



    documentclass[12pt,a4paper,twoside]{report}
    %usepackage[latin1]{inputenc} % shouldn't you be using 'utf8'?
    usepackage{amsmath}
    %%%usepackage{amsfonts} % is loaded automatically by 'amssymb'
    usepackage{amssymb}
    usepackage{graphicx}

    usepackage{multirow}
    usepackage{array}
    newcolumntype{M}[1]{>{centeringarraybackslash}m{#1textwidth}}

    setlength{textheight}{9in} % Height of the main body of the text
    setlength{topmargin}{-.5in} % .5" margin on top of page
    setlength{headsep}{.5in} % space between header and top of body
    addtolength{headsep}{-headheight} % See The LaTeX Companion, p 85
    setlength{footskip}{.5in} % space between footer and bottom of body
    setlength{textwidth}{6.25in} % width of the body of the text
    setlength{oddsidemargin}{.25in} % 1.25" margin on the left for odd pages
    setlength{evensidemargin}{0in} % 1.25" margin on the right for even pages

    % Marginal notes
    setlength{marginparwidth}{.75in} % width of marginal notes
    setlength{marginparsep}{.125in} % space between marginal notes and text
    usepackage{booktabs}

    begin{document}
    begin{table}[ht]
    renewcommand{arraystretch}{1.5}
    setlengthtabcolsep{0pt}
    caption[A caption]{A caption}
    label{tab-brachy-review}
    footnotesize
    begin{tabular*}{textwidth}{@{extracolsep{fill}}%
    M{0.1}M{0.14}M{0.13}M{0.15}M{0.13}M{0.14}M{0.085}M{0.125}}

    Refs & Site & Method & Sample Size & fractions & Delay (days) & BF and Perm & test \ midrule
    Janssen & Te & 1 & 23 & 25 / 5 & Day 5textsuperscript{a} & Increase & NSC \ midrule
    multirow{3}{*}{Coolens} & multirow{3}{*}{Li} & multirow{3}{*}{2} & multirow{3}{*}{6} & multirow{3}{*}{30-54 / 6} & Day 3textsuperscript{a} & Increase & Increase \ cmidrule{6-8}
    & & & & & 30 & Decrease & NSC \ cmidrule{6-8}
    & & & & & 60 & Decrease & NSC \ cmidrule{6-8}
    Janssen & Te & 1 & 23 & 25 / 5 & Day 5textsuperscript{a} & Increase & NSC \ bottomrule
    end{tabular*}
    end{table}
    end{document}








    share

























      0












      0








      0








      I am trying to figure something out that I can't find the answer to.



      I am trying to create a table where some cells in a row need to have multiple rows. I thought "multirow" would allow me to do this, which it does, but it incorrectly vertically centers the data that spans multiple rows. See the attached figure - it ends up being too high.enter image description here



      I realize that in the example I sent, I can just use 3 rows with the top and bottom being empty but in the case of having an even number of split rows, that method isn't possible. I also looked at the documentation for multirow and they specify that there is a finetuning parameter where you can adjust its height manually. I do not want to do this because if I am off even by a little bit it won't line up. Plus I figured there would be a better way.



      Here is a MWE



      documentclass[12pt,a4paper,twoside]{report}
      %usepackage[latin1]{inputenc} % shouldn't you be using 'utf8'?
      usepackage{amsmath}
      %%%usepackage{amsfonts} % is loaded automatically by 'amssymb'
      usepackage{amssymb}
      usepackage{graphicx}

      usepackage{multirow}
      usepackage{array}
      newcolumntype{M}[1]{>{centeringarraybackslash}m{#1textwidth}}

      setlength{textheight}{9in} % Height of the main body of the text
      setlength{topmargin}{-.5in} % .5" margin on top of page
      setlength{headsep}{.5in} % space between header and top of body
      addtolength{headsep}{-headheight} % See The LaTeX Companion, p 85
      setlength{footskip}{.5in} % space between footer and bottom of body
      setlength{textwidth}{6.25in} % width of the body of the text
      setlength{oddsidemargin}{.25in} % 1.25" margin on the left for odd pages
      setlength{evensidemargin}{0in} % 1.25" margin on the right for even pages

      % Marginal notes
      setlength{marginparwidth}{.75in} % width of marginal notes
      setlength{marginparsep}{.125in} % space between marginal notes and text
      usepackage{booktabs}

      begin{document}
      begin{table}[ht]
      renewcommand{arraystretch}{1.5}
      setlengthtabcolsep{0pt}
      caption[A caption]{A caption}
      label{tab-brachy-review}
      footnotesize
      begin{tabular*}{textwidth}{@{extracolsep{fill}}%
      M{0.1}M{0.14}M{0.13}M{0.15}M{0.13}M{0.14}M{0.085}M{0.125}}

      Refs & Site & Method & Sample Size & fractions & Delay (days) & BF and Perm & test \ midrule
      Janssen & Te & 1 & 23 & 25 / 5 & Day 5textsuperscript{a} & Increase & NSC \ midrule
      multirow{3}{*}{Coolens} & multirow{3}{*}{Li} & multirow{3}{*}{2} & multirow{3}{*}{6} & multirow{3}{*}{30-54 / 6} & Day 3textsuperscript{a} & Increase & Increase \ cmidrule{6-8}
      & & & & & 30 & Decrease & NSC \ cmidrule{6-8}
      & & & & & 60 & Decrease & NSC \ cmidrule{6-8}
      Janssen & Te & 1 & 23 & 25 / 5 & Day 5textsuperscript{a} & Increase & NSC \ bottomrule
      end{tabular*}
      end{table}
      end{document}








      share














      I am trying to figure something out that I can't find the answer to.



      I am trying to create a table where some cells in a row need to have multiple rows. I thought "multirow" would allow me to do this, which it does, but it incorrectly vertically centers the data that spans multiple rows. See the attached figure - it ends up being too high.enter image description here



      I realize that in the example I sent, I can just use 3 rows with the top and bottom being empty but in the case of having an even number of split rows, that method isn't possible. I also looked at the documentation for multirow and they specify that there is a finetuning parameter where you can adjust its height manually. I do not want to do this because if I am off even by a little bit it won't line up. Plus I figured there would be a better way.



      Here is a MWE



      documentclass[12pt,a4paper,twoside]{report}
      %usepackage[latin1]{inputenc} % shouldn't you be using 'utf8'?
      usepackage{amsmath}
      %%%usepackage{amsfonts} % is loaded automatically by 'amssymb'
      usepackage{amssymb}
      usepackage{graphicx}

      usepackage{multirow}
      usepackage{array}
      newcolumntype{M}[1]{>{centeringarraybackslash}m{#1textwidth}}

      setlength{textheight}{9in} % Height of the main body of the text
      setlength{topmargin}{-.5in} % .5" margin on top of page
      setlength{headsep}{.5in} % space between header and top of body
      addtolength{headsep}{-headheight} % See The LaTeX Companion, p 85
      setlength{footskip}{.5in} % space between footer and bottom of body
      setlength{textwidth}{6.25in} % width of the body of the text
      setlength{oddsidemargin}{.25in} % 1.25" margin on the left for odd pages
      setlength{evensidemargin}{0in} % 1.25" margin on the right for even pages

      % Marginal notes
      setlength{marginparwidth}{.75in} % width of marginal notes
      setlength{marginparsep}{.125in} % space between marginal notes and text
      usepackage{booktabs}

      begin{document}
      begin{table}[ht]
      renewcommand{arraystretch}{1.5}
      setlengthtabcolsep{0pt}
      caption[A caption]{A caption}
      label{tab-brachy-review}
      footnotesize
      begin{tabular*}{textwidth}{@{extracolsep{fill}}%
      M{0.1}M{0.14}M{0.13}M{0.15}M{0.13}M{0.14}M{0.085}M{0.125}}

      Refs & Site & Method & Sample Size & fractions & Delay (days) & BF and Perm & test \ midrule
      Janssen & Te & 1 & 23 & 25 / 5 & Day 5textsuperscript{a} & Increase & NSC \ midrule
      multirow{3}{*}{Coolens} & multirow{3}{*}{Li} & multirow{3}{*}{2} & multirow{3}{*}{6} & multirow{3}{*}{30-54 / 6} & Day 3textsuperscript{a} & Increase & Increase \ cmidrule{6-8}
      & & & & & 30 & Decrease & NSC \ cmidrule{6-8}
      & & & & & 60 & Decrease & NSC \ cmidrule{6-8}
      Janssen & Te & 1 & 23 & 25 / 5 & Day 5textsuperscript{a} & Increase & NSC \ bottomrule
      end{tabular*}
      end{table}
      end{document}






      tables multirow





      share












      share










      share



      share










      asked 2 mins ago









      thatguy14thatguy14

      203




      203






















          0






          active

          oldest

          votes












          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%2f482669%2fvertical-centering-with-multirow-and-tables%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          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%2f482669%2fvertical-centering-with-multirow-and-tables%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

          Can't compile dgruyter and caption packagesLaTeX templates/packages for writing a patent specificationLatex...

          Schneeberg (Smreczany) Bibliografia | Menu...

          Hans Bellmer Spis treści Życiorys | Upamiętnienie | Przypisy | Bibliografia | Linki zewnętrzne |...