Vertical aligment in complex table











up vote
0
down vote

favorite
1












I am trying to create a table like this one here:
enter image description here



The problem I have is that it requires a lot of finite tuning for each cell to be centered, and I'm planning to add more rows for different kanji symbols (which may have more subrows for each (K) and (O) row.
Is there a way to configure the alignment programatically?



Here is the code for the table I showed (must be compiled with XeLaTeX compiler):



documentclass[12pt]{article}
usepackage{xeCJK}
usepackage{ruby}
usepackage{multicol}
usepackage{multirow}
usepackage{array}

renewcommand{rubysep}{-4ex}
newcommand{mr}[2]{multirow[c]{#1}{*}{#2}}
newcommandBstrut{rule[-2.5ex]{0pt}{0pt}}
newcolumntype{M}[1]{>{centeringarraybackslash}m{#1}}
% I added more height to the cells to allow the japanese characters to have space for the text below them
renewcommand{arraystretch}{2}
pagestyle{empty}
begin{document}
begin{table}[!ht]

hspace{-2cm}begin{tabular}{|M{1.5cm}|m{3cm}|M{2cm}|M{2.8cm}|M{3cm}|M{2.8cm}|}
hline
% The multicolumn commands used here are needed to align vertically the cells
multicolumn{1}{|c|}{漢字} & multicolumn{1}{c|}{Explicación} & multicolumn{2}{c|}{くんよみ(K)•おんよみ(O)} & multicolumn{1}{c|}{Palabras} & multicolumn{1}{c|}{Significado}\
hline
hline
multirow[c]{7}{*}{人} & multirow[c]{7}{3cm}[0.2pt]{Persona. newline Indica el lugar de procedencia de la persona. newline Contador de personas.} & K & ひと & ruby{人}{ひと}Bstrut & Persona\
cline{3-6}
& & multirow{3}{*}[0.2cm]{O} & ジン & アルゼンチンruby{人}{じん}Bstrut & Argentino\
cline{4-6}
& & & ニン & ruby{三}{3}ruby{人}{にん} & Contador: Tres personas\
cline{3-6}
& & multicolumn{2}{c|}{multirow{3}{*}{Excepciones}} & ruby{一人}{ひとり} & Contador: Una persona\
cline{5-6}
& & multicolumn{2}{c|}{} & ruby{二人}{ふたり} & Contador: Dos personas\
hline
end{tabular}
end{table}
end{document}









share|improve this question









New contributor




Bluejay is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
























    up vote
    0
    down vote

    favorite
    1












    I am trying to create a table like this one here:
    enter image description here



    The problem I have is that it requires a lot of finite tuning for each cell to be centered, and I'm planning to add more rows for different kanji symbols (which may have more subrows for each (K) and (O) row.
    Is there a way to configure the alignment programatically?



    Here is the code for the table I showed (must be compiled with XeLaTeX compiler):



    documentclass[12pt]{article}
    usepackage{xeCJK}
    usepackage{ruby}
    usepackage{multicol}
    usepackage{multirow}
    usepackage{array}

    renewcommand{rubysep}{-4ex}
    newcommand{mr}[2]{multirow[c]{#1}{*}{#2}}
    newcommandBstrut{rule[-2.5ex]{0pt}{0pt}}
    newcolumntype{M}[1]{>{centeringarraybackslash}m{#1}}
    % I added more height to the cells to allow the japanese characters to have space for the text below them
    renewcommand{arraystretch}{2}
    pagestyle{empty}
    begin{document}
    begin{table}[!ht]

    hspace{-2cm}begin{tabular}{|M{1.5cm}|m{3cm}|M{2cm}|M{2.8cm}|M{3cm}|M{2.8cm}|}
    hline
    % The multicolumn commands used here are needed to align vertically the cells
    multicolumn{1}{|c|}{漢字} & multicolumn{1}{c|}{Explicación} & multicolumn{2}{c|}{くんよみ(K)•おんよみ(O)} & multicolumn{1}{c|}{Palabras} & multicolumn{1}{c|}{Significado}\
    hline
    hline
    multirow[c]{7}{*}{人} & multirow[c]{7}{3cm}[0.2pt]{Persona. newline Indica el lugar de procedencia de la persona. newline Contador de personas.} & K & ひと & ruby{人}{ひと}Bstrut & Persona\
    cline{3-6}
    & & multirow{3}{*}[0.2cm]{O} & ジン & アルゼンチンruby{人}{じん}Bstrut & Argentino\
    cline{4-6}
    & & & ニン & ruby{三}{3}ruby{人}{にん} & Contador: Tres personas\
    cline{3-6}
    & & multicolumn{2}{c|}{multirow{3}{*}{Excepciones}} & ruby{一人}{ひとり} & Contador: Una persona\
    cline{5-6}
    & & multicolumn{2}{c|}{} & ruby{二人}{ふたり} & Contador: Dos personas\
    hline
    end{tabular}
    end{table}
    end{document}









    share|improve this question









    New contributor




    Bluejay is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.






















      up vote
      0
      down vote

      favorite
      1









      up vote
      0
      down vote

      favorite
      1






      1





      I am trying to create a table like this one here:
      enter image description here



      The problem I have is that it requires a lot of finite tuning for each cell to be centered, and I'm planning to add more rows for different kanji symbols (which may have more subrows for each (K) and (O) row.
      Is there a way to configure the alignment programatically?



      Here is the code for the table I showed (must be compiled with XeLaTeX compiler):



      documentclass[12pt]{article}
      usepackage{xeCJK}
      usepackage{ruby}
      usepackage{multicol}
      usepackage{multirow}
      usepackage{array}

      renewcommand{rubysep}{-4ex}
      newcommand{mr}[2]{multirow[c]{#1}{*}{#2}}
      newcommandBstrut{rule[-2.5ex]{0pt}{0pt}}
      newcolumntype{M}[1]{>{centeringarraybackslash}m{#1}}
      % I added more height to the cells to allow the japanese characters to have space for the text below them
      renewcommand{arraystretch}{2}
      pagestyle{empty}
      begin{document}
      begin{table}[!ht]

      hspace{-2cm}begin{tabular}{|M{1.5cm}|m{3cm}|M{2cm}|M{2.8cm}|M{3cm}|M{2.8cm}|}
      hline
      % The multicolumn commands used here are needed to align vertically the cells
      multicolumn{1}{|c|}{漢字} & multicolumn{1}{c|}{Explicación} & multicolumn{2}{c|}{くんよみ(K)•おんよみ(O)} & multicolumn{1}{c|}{Palabras} & multicolumn{1}{c|}{Significado}\
      hline
      hline
      multirow[c]{7}{*}{人} & multirow[c]{7}{3cm}[0.2pt]{Persona. newline Indica el lugar de procedencia de la persona. newline Contador de personas.} & K & ひと & ruby{人}{ひと}Bstrut & Persona\
      cline{3-6}
      & & multirow{3}{*}[0.2cm]{O} & ジン & アルゼンチンruby{人}{じん}Bstrut & Argentino\
      cline{4-6}
      & & & ニン & ruby{三}{3}ruby{人}{にん} & Contador: Tres personas\
      cline{3-6}
      & & multicolumn{2}{c|}{multirow{3}{*}{Excepciones}} & ruby{一人}{ひとり} & Contador: Una persona\
      cline{5-6}
      & & multicolumn{2}{c|}{} & ruby{二人}{ふたり} & Contador: Dos personas\
      hline
      end{tabular}
      end{table}
      end{document}









      share|improve this question









      New contributor




      Bluejay is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      I am trying to create a table like this one here:
      enter image description here



      The problem I have is that it requires a lot of finite tuning for each cell to be centered, and I'm planning to add more rows for different kanji symbols (which may have more subrows for each (K) and (O) row.
      Is there a way to configure the alignment programatically?



      Here is the code for the table I showed (must be compiled with XeLaTeX compiler):



      documentclass[12pt]{article}
      usepackage{xeCJK}
      usepackage{ruby}
      usepackage{multicol}
      usepackage{multirow}
      usepackage{array}

      renewcommand{rubysep}{-4ex}
      newcommand{mr}[2]{multirow[c]{#1}{*}{#2}}
      newcommandBstrut{rule[-2.5ex]{0pt}{0pt}}
      newcolumntype{M}[1]{>{centeringarraybackslash}m{#1}}
      % I added more height to the cells to allow the japanese characters to have space for the text below them
      renewcommand{arraystretch}{2}
      pagestyle{empty}
      begin{document}
      begin{table}[!ht]

      hspace{-2cm}begin{tabular}{|M{1.5cm}|m{3cm}|M{2cm}|M{2.8cm}|M{3cm}|M{2.8cm}|}
      hline
      % The multicolumn commands used here are needed to align vertically the cells
      multicolumn{1}{|c|}{漢字} & multicolumn{1}{c|}{Explicación} & multicolumn{2}{c|}{くんよみ(K)•おんよみ(O)} & multicolumn{1}{c|}{Palabras} & multicolumn{1}{c|}{Significado}\
      hline
      hline
      multirow[c]{7}{*}{人} & multirow[c]{7}{3cm}[0.2pt]{Persona. newline Indica el lugar de procedencia de la persona. newline Contador de personas.} & K & ひと & ruby{人}{ひと}Bstrut & Persona\
      cline{3-6}
      & & multirow{3}{*}[0.2cm]{O} & ジン & アルゼンチンruby{人}{じん}Bstrut & Argentino\
      cline{4-6}
      & & & ニン & ruby{三}{3}ruby{人}{にん} & Contador: Tres personas\
      cline{3-6}
      & & multicolumn{2}{c|}{multirow{3}{*}{Excepciones}} & ruby{一人}{ひとり} & Contador: Una persona\
      cline{5-6}
      & & multicolumn{2}{c|}{} & ruby{二人}{ふたり} & Contador: Dos personas\
      hline
      end{tabular}
      end{table}
      end{document}






      tables multirow multicolumn






      share|improve this question









      New contributor




      Bluejay is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question









      New contributor




      Bluejay is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question








      edited Nov 20 at 17:37





















      New contributor




      Bluejay is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked Nov 20 at 17:29









      Bluejay

      11




      11




      New contributor




      Bluejay is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      Bluejay is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      Bluejay is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.



























          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',
          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
          });


          }
          });






          Bluejay is a new contributor. Be nice, and check out our Code of Conduct.










           

          draft saved


          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f460999%2fvertical-aligment-in-complex-table%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown






























          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          Bluejay is a new contributor. Be nice, and check out our Code of Conduct.










           

          draft saved


          draft discarded


















          Bluejay is a new contributor. Be nice, and check out our Code of Conduct.













          Bluejay is a new contributor. Be nice, and check out our Code of Conduct.












          Bluejay is a new contributor. Be nice, and check out our Code of Conduct.















           


          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f460999%2fvertical-aligment-in-complex-table%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

          How to send String Array data to Server using php in android

          Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

          Is anime1.com a legal site for watching anime?