Discontinuous line using multirow












2















I've been struggling with table editing, so I started using a website to generate tables in LaTeX. However, whenever I'm using multirow and borders, things get a little tricky. I get a discontinuous line along my column.



As a test, I'm using this:



begin{table}
centering
caption{My caption}
label{my-label}
begin{tabular}{@{}c|cc@{}}
Test & a & b \ midrule
multirow{2}{*}{x} & 1 & 2 \ cmidrule(l){2-3}
& 3 & 4
end{tabular}
end{table}


This is the result:



test table



I'm using TexPortable with MiKTeX 2.9.6210 and Texmaker 4.5.










share|improve this question





























    2















    I've been struggling with table editing, so I started using a website to generate tables in LaTeX. However, whenever I'm using multirow and borders, things get a little tricky. I get a discontinuous line along my column.



    As a test, I'm using this:



    begin{table}
    centering
    caption{My caption}
    label{my-label}
    begin{tabular}{@{}c|cc@{}}
    Test & a & b \ midrule
    multirow{2}{*}{x} & 1 & 2 \ cmidrule(l){2-3}
    & 3 & 4
    end{tabular}
    end{table}


    This is the result:



    test table



    I'm using TexPortable with MiKTeX 2.9.6210 and Texmaker 4.5.










    share|improve this question



























      2












      2








      2


      0






      I've been struggling with table editing, so I started using a website to generate tables in LaTeX. However, whenever I'm using multirow and borders, things get a little tricky. I get a discontinuous line along my column.



      As a test, I'm using this:



      begin{table}
      centering
      caption{My caption}
      label{my-label}
      begin{tabular}{@{}c|cc@{}}
      Test & a & b \ midrule
      multirow{2}{*}{x} & 1 & 2 \ cmidrule(l){2-3}
      & 3 & 4
      end{tabular}
      end{table}


      This is the result:



      test table



      I'm using TexPortable with MiKTeX 2.9.6210 and Texmaker 4.5.










      share|improve this question
















      I've been struggling with table editing, so I started using a website to generate tables in LaTeX. However, whenever I'm using multirow and borders, things get a little tricky. I get a discontinuous line along my column.



      As a test, I'm using this:



      begin{table}
      centering
      caption{My caption}
      label{my-label}
      begin{tabular}{@{}c|cc@{}}
      Test & a & b \ midrule
      multirow{2}{*}{x} & 1 & 2 \ cmidrule(l){2-3}
      & 3 & 4
      end{tabular}
      end{table}


      This is the result:



      test table



      I'm using TexPortable with MiKTeX 2.9.6210 and Texmaker 4.5.







      tables border






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Apr 26 '17 at 8:56









      Moriambar

      7,94531846




      7,94531846










      asked Apr 26 '17 at 8:28









      Tiago CorreiaTiago Correia

      1019




      1019






















          1 Answer
          1






          active

          oldest

          votes


















          4














          This is related to the padding around horizontal lines in booktabs (the lengths aboverulesep and belowrulesep). Vertical rules should not be used with booktabs in general (this principle suffers exceptions). A workaround consists in setting them to 0 and replacing them with more or less equivalent lengths added at the top and bottom of cells with the tools from makecell.



          documentclass{article}
          usepackage{booktabs, multirow, array, makecell, caption}

          begin{document}

          begin{table}[!htb]
          centering
          setlengthaboverulesep{0pt}setlengthbelowrulesep{0pt}
          setcellgapes{3pt}makegapedcells
          caption{My caption}
          label{my-label}
          begin{tabular}{@{}c|cc@{}}
          Test & a & b \ midrule
          multirow{2}{*}{x} & 1 & 2 \ addlinespace[-0.03em]cmidrule(l){2-3}
          & 3 & 4
          end{tabular}
          end{table}

          end{document}


          enter image description here






          share|improve this answer


























          • I've tried that and it worked on the vertical line, but the horizontal line is still discontinuous, here. Thank you!

            – Tiago Correia
            Apr 26 '17 at 9:18








          • 1





            Do you mean the short line between 2nd and 3rd row? I thought it was there purposely. The responsible is the (l) optional argument of cmidrule. Just remove it.

            – Bernard
            Apr 26 '17 at 9:25












          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%2f366744%2fdiscontinuous-line-using-multirow%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          4














          This is related to the padding around horizontal lines in booktabs (the lengths aboverulesep and belowrulesep). Vertical rules should not be used with booktabs in general (this principle suffers exceptions). A workaround consists in setting them to 0 and replacing them with more or less equivalent lengths added at the top and bottom of cells with the tools from makecell.



          documentclass{article}
          usepackage{booktabs, multirow, array, makecell, caption}

          begin{document}

          begin{table}[!htb]
          centering
          setlengthaboverulesep{0pt}setlengthbelowrulesep{0pt}
          setcellgapes{3pt}makegapedcells
          caption{My caption}
          label{my-label}
          begin{tabular}{@{}c|cc@{}}
          Test & a & b \ midrule
          multirow{2}{*}{x} & 1 & 2 \ addlinespace[-0.03em]cmidrule(l){2-3}
          & 3 & 4
          end{tabular}
          end{table}

          end{document}


          enter image description here






          share|improve this answer


























          • I've tried that and it worked on the vertical line, but the horizontal line is still discontinuous, here. Thank you!

            – Tiago Correia
            Apr 26 '17 at 9:18








          • 1





            Do you mean the short line between 2nd and 3rd row? I thought it was there purposely. The responsible is the (l) optional argument of cmidrule. Just remove it.

            – Bernard
            Apr 26 '17 at 9:25
















          4














          This is related to the padding around horizontal lines in booktabs (the lengths aboverulesep and belowrulesep). Vertical rules should not be used with booktabs in general (this principle suffers exceptions). A workaround consists in setting them to 0 and replacing them with more or less equivalent lengths added at the top and bottom of cells with the tools from makecell.



          documentclass{article}
          usepackage{booktabs, multirow, array, makecell, caption}

          begin{document}

          begin{table}[!htb]
          centering
          setlengthaboverulesep{0pt}setlengthbelowrulesep{0pt}
          setcellgapes{3pt}makegapedcells
          caption{My caption}
          label{my-label}
          begin{tabular}{@{}c|cc@{}}
          Test & a & b \ midrule
          multirow{2}{*}{x} & 1 & 2 \ addlinespace[-0.03em]cmidrule(l){2-3}
          & 3 & 4
          end{tabular}
          end{table}

          end{document}


          enter image description here






          share|improve this answer


























          • I've tried that and it worked on the vertical line, but the horizontal line is still discontinuous, here. Thank you!

            – Tiago Correia
            Apr 26 '17 at 9:18








          • 1





            Do you mean the short line between 2nd and 3rd row? I thought it was there purposely. The responsible is the (l) optional argument of cmidrule. Just remove it.

            – Bernard
            Apr 26 '17 at 9:25














          4












          4








          4







          This is related to the padding around horizontal lines in booktabs (the lengths aboverulesep and belowrulesep). Vertical rules should not be used with booktabs in general (this principle suffers exceptions). A workaround consists in setting them to 0 and replacing them with more or less equivalent lengths added at the top and bottom of cells with the tools from makecell.



          documentclass{article}
          usepackage{booktabs, multirow, array, makecell, caption}

          begin{document}

          begin{table}[!htb]
          centering
          setlengthaboverulesep{0pt}setlengthbelowrulesep{0pt}
          setcellgapes{3pt}makegapedcells
          caption{My caption}
          label{my-label}
          begin{tabular}{@{}c|cc@{}}
          Test & a & b \ midrule
          multirow{2}{*}{x} & 1 & 2 \ addlinespace[-0.03em]cmidrule(l){2-3}
          & 3 & 4
          end{tabular}
          end{table}

          end{document}


          enter image description here






          share|improve this answer















          This is related to the padding around horizontal lines in booktabs (the lengths aboverulesep and belowrulesep). Vertical rules should not be used with booktabs in general (this principle suffers exceptions). A workaround consists in setting them to 0 and replacing them with more or less equivalent lengths added at the top and bottom of cells with the tools from makecell.



          documentclass{article}
          usepackage{booktabs, multirow, array, makecell, caption}

          begin{document}

          begin{table}[!htb]
          centering
          setlengthaboverulesep{0pt}setlengthbelowrulesep{0pt}
          setcellgapes{3pt}makegapedcells
          caption{My caption}
          label{my-label}
          begin{tabular}{@{}c|cc@{}}
          Test & a & b \ midrule
          multirow{2}{*}{x} & 1 & 2 \ addlinespace[-0.03em]cmidrule(l){2-3}
          & 3 & 4
          end{tabular}
          end{table}

          end{document}


          enter image description here







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 4 hours ago

























          answered Apr 26 '17 at 8:56









          BernardBernard

          175k776207




          175k776207













          • I've tried that and it worked on the vertical line, but the horizontal line is still discontinuous, here. Thank you!

            – Tiago Correia
            Apr 26 '17 at 9:18








          • 1





            Do you mean the short line between 2nd and 3rd row? I thought it was there purposely. The responsible is the (l) optional argument of cmidrule. Just remove it.

            – Bernard
            Apr 26 '17 at 9:25



















          • I've tried that and it worked on the vertical line, but the horizontal line is still discontinuous, here. Thank you!

            – Tiago Correia
            Apr 26 '17 at 9:18








          • 1





            Do you mean the short line between 2nd and 3rd row? I thought it was there purposely. The responsible is the (l) optional argument of cmidrule. Just remove it.

            – Bernard
            Apr 26 '17 at 9:25

















          I've tried that and it worked on the vertical line, but the horizontal line is still discontinuous, here. Thank you!

          – Tiago Correia
          Apr 26 '17 at 9:18







          I've tried that and it worked on the vertical line, but the horizontal line is still discontinuous, here. Thank you!

          – Tiago Correia
          Apr 26 '17 at 9:18






          1




          1





          Do you mean the short line between 2nd and 3rd row? I thought it was there purposely. The responsible is the (l) optional argument of cmidrule. Just remove it.

          – Bernard
          Apr 26 '17 at 9:25





          Do you mean the short line between 2nd and 3rd row? I thought it was there purposely. The responsible is the (l) optional argument of cmidrule. Just remove it.

          – Bernard
          Apr 26 '17 at 9:25


















          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%2f366744%2fdiscontinuous-line-using-multirow%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

          Contact image not getting when fetch all contact list from iPhone by CNContact

          count number of partitions of a set with n elements into k subsets

          A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks