Vertical aligment in complex table
up vote
0
down vote
favorite
I am trying to create a table like this one 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
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.
add a comment |
up vote
0
down vote
favorite
I am trying to create a table like this one 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
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.
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I am trying to create a table like this one 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
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:

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
tables multirow multicolumn
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.
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.
add a comment |
add a comment |
active
oldest
votes
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.
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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