Change column specification for single specific cells
Say I have a table with some data, a header row and a summary. The table has specific column specifications, like below
documentclass{article}
setlengthparskip{1em}
begin{document}
% Consider this table:
begin{tabular}{l@{~--~}l}%<- Makes a dash between columns
NODASH1 & NODASH2 \hline
beforedash & afterdash \
beforedash & afterdash \hline
Sum & NODASH!
end{tabular}
Below, a possible workaround that I don't really fancy
defnodash#1{multicolumn{1}{l}{#1}}
% Now using the nodash to remove the dashes that I don't want
begin{tabular}{l@{~--~}l}
nodash{NODASH1} & NODASH2 \hline
beforedash & afterdash \
beforedash & afterdash \hline
nodash{Sum} & NODASH!
end{tabular}
end{document}
Which produces the following output:

So I'm looking for a more canonical way to produce the bottom table.
Any ideas?
tables multicolumn columns
add a comment |
Say I have a table with some data, a header row and a summary. The table has specific column specifications, like below
documentclass{article}
setlengthparskip{1em}
begin{document}
% Consider this table:
begin{tabular}{l@{~--~}l}%<- Makes a dash between columns
NODASH1 & NODASH2 \hline
beforedash & afterdash \
beforedash & afterdash \hline
Sum & NODASH!
end{tabular}
Below, a possible workaround that I don't really fancy
defnodash#1{multicolumn{1}{l}{#1}}
% Now using the nodash to remove the dashes that I don't want
begin{tabular}{l@{~--~}l}
nodash{NODASH1} & NODASH2 \hline
beforedash & afterdash \
beforedash & afterdash \hline
nodash{Sum} & NODASH!
end{tabular}
end{document}
Which produces the following output:

So I'm looking for a more canonical way to produce the bottom table.
Any ideas?
tables multicolumn columns
2
Your write-up and code are slightly confusing. E.g., what is the purpose of the third column in bothtabularenvironments?
– Mico
yesterday
@Mico yup - that was very confusing, and there wasn't supposed to be a third column! Is it clear now?
– Andreas Storvik Strauman
yesterday
Another issue with your posting is that the title contains the qualifier "for only one single row". However, a careful reading of your posting suggests that you actually wish to change the column specification for two cells, not for one row. You may want to edit your posting to eliminate the need for people to guess as to what you really want to achieve...
– Mico
yesterday
add a comment |
Say I have a table with some data, a header row and a summary. The table has specific column specifications, like below
documentclass{article}
setlengthparskip{1em}
begin{document}
% Consider this table:
begin{tabular}{l@{~--~}l}%<- Makes a dash between columns
NODASH1 & NODASH2 \hline
beforedash & afterdash \
beforedash & afterdash \hline
Sum & NODASH!
end{tabular}
Below, a possible workaround that I don't really fancy
defnodash#1{multicolumn{1}{l}{#1}}
% Now using the nodash to remove the dashes that I don't want
begin{tabular}{l@{~--~}l}
nodash{NODASH1} & NODASH2 \hline
beforedash & afterdash \
beforedash & afterdash \hline
nodash{Sum} & NODASH!
end{tabular}
end{document}
Which produces the following output:

So I'm looking for a more canonical way to produce the bottom table.
Any ideas?
tables multicolumn columns
Say I have a table with some data, a header row and a summary. The table has specific column specifications, like below
documentclass{article}
setlengthparskip{1em}
begin{document}
% Consider this table:
begin{tabular}{l@{~--~}l}%<- Makes a dash between columns
NODASH1 & NODASH2 \hline
beforedash & afterdash \
beforedash & afterdash \hline
Sum & NODASH!
end{tabular}
Below, a possible workaround that I don't really fancy
defnodash#1{multicolumn{1}{l}{#1}}
% Now using the nodash to remove the dashes that I don't want
begin{tabular}{l@{~--~}l}
nodash{NODASH1} & NODASH2 \hline
beforedash & afterdash \
beforedash & afterdash \hline
nodash{Sum} & NODASH!
end{tabular}
end{document}
Which produces the following output:

So I'm looking for a more canonical way to produce the bottom table.
Any ideas?
tables multicolumn columns
tables multicolumn columns
edited yesterday
Andreas Storvik Strauman
asked yesterday
Andreas Storvik StraumanAndreas Storvik Strauman
2,612418
2,612418
2
Your write-up and code are slightly confusing. E.g., what is the purpose of the third column in bothtabularenvironments?
– Mico
yesterday
@Mico yup - that was very confusing, and there wasn't supposed to be a third column! Is it clear now?
– Andreas Storvik Strauman
yesterday
Another issue with your posting is that the title contains the qualifier "for only one single row". However, a careful reading of your posting suggests that you actually wish to change the column specification for two cells, not for one row. You may want to edit your posting to eliminate the need for people to guess as to what you really want to achieve...
– Mico
yesterday
add a comment |
2
Your write-up and code are slightly confusing. E.g., what is the purpose of the third column in bothtabularenvironments?
– Mico
yesterday
@Mico yup - that was very confusing, and there wasn't supposed to be a third column! Is it clear now?
– Andreas Storvik Strauman
yesterday
Another issue with your posting is that the title contains the qualifier "for only one single row". However, a careful reading of your posting suggests that you actually wish to change the column specification for two cells, not for one row. You may want to edit your posting to eliminate the need for people to guess as to what you really want to achieve...
– Mico
yesterday
2
2
Your write-up and code are slightly confusing. E.g., what is the purpose of the third column in both
tabular environments?– Mico
yesterday
Your write-up and code are slightly confusing. E.g., what is the purpose of the third column in both
tabular environments?– Mico
yesterday
@Mico yup - that was very confusing, and there wasn't supposed to be a third column! Is it clear now?
– Andreas Storvik Strauman
yesterday
@Mico yup - that was very confusing, and there wasn't supposed to be a third column! Is it clear now?
– Andreas Storvik Strauman
yesterday
Another issue with your posting is that the title contains the qualifier "for only one single row". However, a careful reading of your posting suggests that you actually wish to change the column specification for two cells, not for one row. You may want to edit your posting to eliminate the need for people to guess as to what you really want to achieve...
– Mico
yesterday
Another issue with your posting is that the title contains the qualifier "for only one single row". However, a careful reading of your posting suggests that you actually wish to change the column specification for two cells, not for one row. You may want to edit your posting to eliminate the need for people to guess as to what you really want to achieve...
– Mico
yesterday
add a comment |
1 Answer
1
active
oldest
votes
Using multicolumn{1} is the intended interface to specifying a different layout for heading or other rows. Note that you can get away with the simple
multicolumn{1}{l}{...}
here as it is a left-aligned column.
For a right (or center) aligned column you would need
multicolumn{1}{r@{phantom{~--~}}{#1}}
so that the alignment didn't spread into the inter-column space generated by the @ expression in the main tabular preamble.
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%2f484775%2fchange-column-specification-for-single-specific-cells%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
Using multicolumn{1} is the intended interface to specifying a different layout for heading or other rows. Note that you can get away with the simple
multicolumn{1}{l}{...}
here as it is a left-aligned column.
For a right (or center) aligned column you would need
multicolumn{1}{r@{phantom{~--~}}{#1}}
so that the alignment didn't spread into the inter-column space generated by the @ expression in the main tabular preamble.
add a comment |
Using multicolumn{1} is the intended interface to specifying a different layout for heading or other rows. Note that you can get away with the simple
multicolumn{1}{l}{...}
here as it is a left-aligned column.
For a right (or center) aligned column you would need
multicolumn{1}{r@{phantom{~--~}}{#1}}
so that the alignment didn't spread into the inter-column space generated by the @ expression in the main tabular preamble.
add a comment |
Using multicolumn{1} is the intended interface to specifying a different layout for heading or other rows. Note that you can get away with the simple
multicolumn{1}{l}{...}
here as it is a left-aligned column.
For a right (or center) aligned column you would need
multicolumn{1}{r@{phantom{~--~}}{#1}}
so that the alignment didn't spread into the inter-column space generated by the @ expression in the main tabular preamble.
Using multicolumn{1} is the intended interface to specifying a different layout for heading or other rows. Note that you can get away with the simple
multicolumn{1}{l}{...}
here as it is a left-aligned column.
For a right (or center) aligned column you would need
multicolumn{1}{r@{phantom{~--~}}{#1}}
so that the alignment didn't spread into the inter-column space generated by the @ expression in the main tabular preamble.
answered yesterday
David CarlisleDavid Carlisle
499k4111451895
499k4111451895
add a comment |
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%2f484775%2fchange-column-specification-for-single-specific-cells%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
2
Your write-up and code are slightly confusing. E.g., what is the purpose of the third column in both
tabularenvironments?– Mico
yesterday
@Mico yup - that was very confusing, and there wasn't supposed to be a third column! Is it clear now?
– Andreas Storvik Strauman
yesterday
Another issue with your posting is that the title contains the qualifier "for only one single row". However, a careful reading of your posting suggests that you actually wish to change the column specification for two cells, not for one row. You may want to edit your posting to eliminate the need for people to guess as to what you really want to achieve...
– Mico
yesterday