Merging table rows instead of splitting them?
I have a table that looks like this:
| COLUMN A | COLUMN B | COLUMN C | COLUMN D |
|-------------------------------------------|
| 0 | A | 100 | 150 |
| 1 | B | 100 | 150 |
| 2 | C | 200 | 250 |
| 3 | D | 200 | 250 |
As you can see, the values in columns A and B are different each row, but columns C and D only change every other row. It would be useful to merge only columns C and D so that they are "shared" between two rows, while columns A and B work as normal. Something like this, but without the blank cells in A and B:
| COLUMN A | COLUMN B | COLUMN C | COLUMN D |
|-------------------------------------------|
| 0 | A | | |
| | | 100 | 150 |
| 1 | B | | |
| 2 | C | | |
| | | 200 | 250 |
| 3 | D | | |
Essentially, it would be the inverse of this answer, which merges the first column in the table and splits subsequent columns.
tables multicolumn
add a comment |
I have a table that looks like this:
| COLUMN A | COLUMN B | COLUMN C | COLUMN D |
|-------------------------------------------|
| 0 | A | 100 | 150 |
| 1 | B | 100 | 150 |
| 2 | C | 200 | 250 |
| 3 | D | 200 | 250 |
As you can see, the values in columns A and B are different each row, but columns C and D only change every other row. It would be useful to merge only columns C and D so that they are "shared" between two rows, while columns A and B work as normal. Something like this, but without the blank cells in A and B:
| COLUMN A | COLUMN B | COLUMN C | COLUMN D |
|-------------------------------------------|
| 0 | A | | |
| | | 100 | 150 |
| 1 | B | | |
| 2 | C | | |
| | | 200 | 250 |
| 3 | D | | |
Essentially, it would be the inverse of this answer, which merges the first column in the table and splits subsequent columns.
tables multicolumn
The solution is the same, simply usemultirowin the column you wish.
– Sigur
1 hour ago
themultirowpackage is your friend :-).
– Zarko
1 hour ago
1
Also, please, post a minimal code so we don't need to type everything for you.
– Sigur
1 hour ago
add a comment |
I have a table that looks like this:
| COLUMN A | COLUMN B | COLUMN C | COLUMN D |
|-------------------------------------------|
| 0 | A | 100 | 150 |
| 1 | B | 100 | 150 |
| 2 | C | 200 | 250 |
| 3 | D | 200 | 250 |
As you can see, the values in columns A and B are different each row, but columns C and D only change every other row. It would be useful to merge only columns C and D so that they are "shared" between two rows, while columns A and B work as normal. Something like this, but without the blank cells in A and B:
| COLUMN A | COLUMN B | COLUMN C | COLUMN D |
|-------------------------------------------|
| 0 | A | | |
| | | 100 | 150 |
| 1 | B | | |
| 2 | C | | |
| | | 200 | 250 |
| 3 | D | | |
Essentially, it would be the inverse of this answer, which merges the first column in the table and splits subsequent columns.
tables multicolumn
I have a table that looks like this:
| COLUMN A | COLUMN B | COLUMN C | COLUMN D |
|-------------------------------------------|
| 0 | A | 100 | 150 |
| 1 | B | 100 | 150 |
| 2 | C | 200 | 250 |
| 3 | D | 200 | 250 |
As you can see, the values in columns A and B are different each row, but columns C and D only change every other row. It would be useful to merge only columns C and D so that they are "shared" between two rows, while columns A and B work as normal. Something like this, but without the blank cells in A and B:
| COLUMN A | COLUMN B | COLUMN C | COLUMN D |
|-------------------------------------------|
| 0 | A | | |
| | | 100 | 150 |
| 1 | B | | |
| 2 | C | | |
| | | 200 | 250 |
| 3 | D | | |
Essentially, it would be the inverse of this answer, which merges the first column in the table and splits subsequent columns.
tables multicolumn
tables multicolumn
asked 1 hour ago
klasdfjasdfklasdfjasdf
323
323
The solution is the same, simply usemultirowin the column you wish.
– Sigur
1 hour ago
themultirowpackage is your friend :-).
– Zarko
1 hour ago
1
Also, please, post a minimal code so we don't need to type everything for you.
– Sigur
1 hour ago
add a comment |
The solution is the same, simply usemultirowin the column you wish.
– Sigur
1 hour ago
themultirowpackage is your friend :-).
– Zarko
1 hour ago
1
Also, please, post a minimal code so we don't need to type everything for you.
– Sigur
1 hour ago
The solution is the same, simply use
multirow in the column you wish.– Sigur
1 hour ago
The solution is the same, simply use
multirow in the column you wish.– Sigur
1 hour ago
the
multirow package is your friend :-).– Zarko
1 hour ago
the
multirow package is your friend :-).– Zarko
1 hour ago
1
1
Also, please, post a minimal code so we don't need to type everything for you.
– Sigur
1 hour ago
Also, please, post a minimal code so we don't need to type everything for you.
– Sigur
1 hour ago
add a comment |
1 Answer
1
active
oldest
votes

documentclass{article}
usepackage{multirow}
begin{document}
begin{tabular}{|*{4}{c|}}
hline
A & B & C & D \
hline
0 & A & multirow{2}{*}{100} & multirow{2}{*}{150} \
1 & B & & \
0 & A & multirow{2}{*}{100} & multirow{2}{*}{150} \
1 & B & & \
hline
end{tabular}
end{document}
Thank you, this works perfectly! May I ask why you put braces around the asterisk in the first multirow but not the second?
– klasdfjasdf
59 mins ago
@klasdfjasdf, i simply forgot. it works with curly braces and without them. however. it is better to use them. i will corrected asap.
– Zarko
51 mins ago
add a comment |
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
});
}
});
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%2f470463%2fmerging-table-rows-instead-of-splitting-them%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

documentclass{article}
usepackage{multirow}
begin{document}
begin{tabular}{|*{4}{c|}}
hline
A & B & C & D \
hline
0 & A & multirow{2}{*}{100} & multirow{2}{*}{150} \
1 & B & & \
0 & A & multirow{2}{*}{100} & multirow{2}{*}{150} \
1 & B & & \
hline
end{tabular}
end{document}
Thank you, this works perfectly! May I ask why you put braces around the asterisk in the first multirow but not the second?
– klasdfjasdf
59 mins ago
@klasdfjasdf, i simply forgot. it works with curly braces and without them. however. it is better to use them. i will corrected asap.
– Zarko
51 mins ago
add a comment |

documentclass{article}
usepackage{multirow}
begin{document}
begin{tabular}{|*{4}{c|}}
hline
A & B & C & D \
hline
0 & A & multirow{2}{*}{100} & multirow{2}{*}{150} \
1 & B & & \
0 & A & multirow{2}{*}{100} & multirow{2}{*}{150} \
1 & B & & \
hline
end{tabular}
end{document}
Thank you, this works perfectly! May I ask why you put braces around the asterisk in the first multirow but not the second?
– klasdfjasdf
59 mins ago
@klasdfjasdf, i simply forgot. it works with curly braces and without them. however. it is better to use them. i will corrected asap.
– Zarko
51 mins ago
add a comment |

documentclass{article}
usepackage{multirow}
begin{document}
begin{tabular}{|*{4}{c|}}
hline
A & B & C & D \
hline
0 & A & multirow{2}{*}{100} & multirow{2}{*}{150} \
1 & B & & \
0 & A & multirow{2}{*}{100} & multirow{2}{*}{150} \
1 & B & & \
hline
end{tabular}
end{document}

documentclass{article}
usepackage{multirow}
begin{document}
begin{tabular}{|*{4}{c|}}
hline
A & B & C & D \
hline
0 & A & multirow{2}{*}{100} & multirow{2}{*}{150} \
1 & B & & \
0 & A & multirow{2}{*}{100} & multirow{2}{*}{150} \
1 & B & & \
hline
end{tabular}
end{document}
edited 51 mins ago
answered 1 hour ago
ZarkoZarko
122k865160
122k865160
Thank you, this works perfectly! May I ask why you put braces around the asterisk in the first multirow but not the second?
– klasdfjasdf
59 mins ago
@klasdfjasdf, i simply forgot. it works with curly braces and without them. however. it is better to use them. i will corrected asap.
– Zarko
51 mins ago
add a comment |
Thank you, this works perfectly! May I ask why you put braces around the asterisk in the first multirow but not the second?
– klasdfjasdf
59 mins ago
@klasdfjasdf, i simply forgot. it works with curly braces and without them. however. it is better to use them. i will corrected asap.
– Zarko
51 mins ago
Thank you, this works perfectly! May I ask why you put braces around the asterisk in the first multirow but not the second?
– klasdfjasdf
59 mins ago
Thank you, this works perfectly! May I ask why you put braces around the asterisk in the first multirow but not the second?
– klasdfjasdf
59 mins ago
@klasdfjasdf, i simply forgot. it works with curly braces and without them. however. it is better to use them. i will corrected asap.
– Zarko
51 mins ago
@klasdfjasdf, i simply forgot. it works with curly braces and without them. however. it is better to use them. i will corrected asap.
– Zarko
51 mins ago
add a comment |
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.
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%2f470463%2fmerging-table-rows-instead-of-splitting-them%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
The solution is the same, simply use
multirowin the column you wish.– Sigur
1 hour ago
the
multirowpackage is your friend :-).– Zarko
1 hour ago
1
Also, please, post a minimal code so we don't need to type everything for you.
– Sigur
1 hour ago