Extra alignment tab has been changed to cr. } using table, tabular and resizebox
I've reveiwed all the other threads on this topic and have not been able to figure it out. It must be something I'm completely missing.
I recieved the error above "Extra alignment tab has been changed to cr. }"
Here's a full reproducible code snippet
begin{table}[h!]
resizebox{5in}{!}{
begin{tabular}[h!]{|c||c|c|c|||c|c|c|}
hline
multicolumn{}{|c||}{Dataset} &
multicolumn{3}{c|||}{A} &
multicolumn{3}{c|}{B} &
hline
bfseries Year & bfseries parameter & bfseries gof & bfseries p-value & bfseries parameter & bfseries gof & bfseries p-value \
hline
1998 & 1.2661 & 0.4046 & 0.57 & 1.2889 & 0.3214 & 0.7 \ hline
1999 & 1.2685 & 0.4049 & 0.58 & 1.2913 & 0.3225 & 0.71 \ hline
2000 & 1.2681 & 0.4053 & 0.57 & 1.2942 & 0.321 & 0.71 \ hline
2001 & 1.2679 & 0.4082 & 0.56 & 1.2896 & 0.3208 & 0.71 \ hline
2002 & 1.2666 & 0.4098 & 0.55 & 1.2907 & 0.321 & 0.71 \ hline
2003 & 1.2673 & 0.4096 & 0.55 & 1.2849 & 0.3203 & 0.71 \ hline
2004 & 1.2678 & 0.409 & 0.57 & 1.2866 & 0.3187 & 0.72 \ hline
end{tabular}
}
caption[stuff]{morestuff}
label{table:all.models}
end{table}
Can anyone see something I'm not seeing?
Thank you in advance!
tables
add a comment |
I've reveiwed all the other threads on this topic and have not been able to figure it out. It must be something I'm completely missing.
I recieved the error above "Extra alignment tab has been changed to cr. }"
Here's a full reproducible code snippet
begin{table}[h!]
resizebox{5in}{!}{
begin{tabular}[h!]{|c||c|c|c|||c|c|c|}
hline
multicolumn{}{|c||}{Dataset} &
multicolumn{3}{c|||}{A} &
multicolumn{3}{c|}{B} &
hline
bfseries Year & bfseries parameter & bfseries gof & bfseries p-value & bfseries parameter & bfseries gof & bfseries p-value \
hline
1998 & 1.2661 & 0.4046 & 0.57 & 1.2889 & 0.3214 & 0.7 \ hline
1999 & 1.2685 & 0.4049 & 0.58 & 1.2913 & 0.3225 & 0.71 \ hline
2000 & 1.2681 & 0.4053 & 0.57 & 1.2942 & 0.321 & 0.71 \ hline
2001 & 1.2679 & 0.4082 & 0.56 & 1.2896 & 0.3208 & 0.71 \ hline
2002 & 1.2666 & 0.4098 & 0.55 & 1.2907 & 0.321 & 0.71 \ hline
2003 & 1.2673 & 0.4096 & 0.55 & 1.2849 & 0.3203 & 0.71 \ hline
2004 & 1.2678 & 0.409 & 0.57 & 1.2866 & 0.3187 & 0.72 \ hline
end{tabular}
}
caption[stuff]{morestuff}
label{table:all.models}
end{table}
Can anyone see something I'm not seeing?
Thank you in advance!
tables
The instructionmulticolumn{}{|c||}{Dataset}
generates a syntax error. Did you mean to writemulticolumn{1}{|c||}{Dataset}
?
– Mico
10 hours ago
THANK YOU!! You're awesome!
– Joseph
10 hours ago
1
You might alos consider not usingresizebox
in order to make the table occupy a certain space as this approach will lead to inconsistent font sizes and line widths throughout your document.
– leandriis
10 hours ago
add a comment |
I've reveiwed all the other threads on this topic and have not been able to figure it out. It must be something I'm completely missing.
I recieved the error above "Extra alignment tab has been changed to cr. }"
Here's a full reproducible code snippet
begin{table}[h!]
resizebox{5in}{!}{
begin{tabular}[h!]{|c||c|c|c|||c|c|c|}
hline
multicolumn{}{|c||}{Dataset} &
multicolumn{3}{c|||}{A} &
multicolumn{3}{c|}{B} &
hline
bfseries Year & bfseries parameter & bfseries gof & bfseries p-value & bfseries parameter & bfseries gof & bfseries p-value \
hline
1998 & 1.2661 & 0.4046 & 0.57 & 1.2889 & 0.3214 & 0.7 \ hline
1999 & 1.2685 & 0.4049 & 0.58 & 1.2913 & 0.3225 & 0.71 \ hline
2000 & 1.2681 & 0.4053 & 0.57 & 1.2942 & 0.321 & 0.71 \ hline
2001 & 1.2679 & 0.4082 & 0.56 & 1.2896 & 0.3208 & 0.71 \ hline
2002 & 1.2666 & 0.4098 & 0.55 & 1.2907 & 0.321 & 0.71 \ hline
2003 & 1.2673 & 0.4096 & 0.55 & 1.2849 & 0.3203 & 0.71 \ hline
2004 & 1.2678 & 0.409 & 0.57 & 1.2866 & 0.3187 & 0.72 \ hline
end{tabular}
}
caption[stuff]{morestuff}
label{table:all.models}
end{table}
Can anyone see something I'm not seeing?
Thank you in advance!
tables
I've reveiwed all the other threads on this topic and have not been able to figure it out. It must be something I'm completely missing.
I recieved the error above "Extra alignment tab has been changed to cr. }"
Here's a full reproducible code snippet
begin{table}[h!]
resizebox{5in}{!}{
begin{tabular}[h!]{|c||c|c|c|||c|c|c|}
hline
multicolumn{}{|c||}{Dataset} &
multicolumn{3}{c|||}{A} &
multicolumn{3}{c|}{B} &
hline
bfseries Year & bfseries parameter & bfseries gof & bfseries p-value & bfseries parameter & bfseries gof & bfseries p-value \
hline
1998 & 1.2661 & 0.4046 & 0.57 & 1.2889 & 0.3214 & 0.7 \ hline
1999 & 1.2685 & 0.4049 & 0.58 & 1.2913 & 0.3225 & 0.71 \ hline
2000 & 1.2681 & 0.4053 & 0.57 & 1.2942 & 0.321 & 0.71 \ hline
2001 & 1.2679 & 0.4082 & 0.56 & 1.2896 & 0.3208 & 0.71 \ hline
2002 & 1.2666 & 0.4098 & 0.55 & 1.2907 & 0.321 & 0.71 \ hline
2003 & 1.2673 & 0.4096 & 0.55 & 1.2849 & 0.3203 & 0.71 \ hline
2004 & 1.2678 & 0.409 & 0.57 & 1.2866 & 0.3187 & 0.72 \ hline
end{tabular}
}
caption[stuff]{morestuff}
label{table:all.models}
end{table}
Can anyone see something I'm not seeing?
Thank you in advance!
tables
tables
edited 10 hours ago
Mico
282k31386774
282k31386774
asked 11 hours ago
JosephJoseph
587
587
The instructionmulticolumn{}{|c||}{Dataset}
generates a syntax error. Did you mean to writemulticolumn{1}{|c||}{Dataset}
?
– Mico
10 hours ago
THANK YOU!! You're awesome!
– Joseph
10 hours ago
1
You might alos consider not usingresizebox
in order to make the table occupy a certain space as this approach will lead to inconsistent font sizes and line widths throughout your document.
– leandriis
10 hours ago
add a comment |
The instructionmulticolumn{}{|c||}{Dataset}
generates a syntax error. Did you mean to writemulticolumn{1}{|c||}{Dataset}
?
– Mico
10 hours ago
THANK YOU!! You're awesome!
– Joseph
10 hours ago
1
You might alos consider not usingresizebox
in order to make the table occupy a certain space as this approach will lead to inconsistent font sizes and line widths throughout your document.
– leandriis
10 hours ago
The instruction
multicolumn{}{|c||}{Dataset}
generates a syntax error. Did you mean to write multicolumn{1}{|c||}{Dataset}
?– Mico
10 hours ago
The instruction
multicolumn{}{|c||}{Dataset}
generates a syntax error. Did you mean to write multicolumn{1}{|c||}{Dataset}
?– Mico
10 hours ago
THANK YOU!! You're awesome!
– Joseph
10 hours ago
THANK YOU!! You're awesome!
– Joseph
10 hours ago
1
1
You might alos consider not using
resizebox
in order to make the table occupy a certain space as this approach will lead to inconsistent font sizes and line widths throughout your document.– leandriis
10 hours ago
You might alos consider not using
resizebox
in order to make the table occupy a certain space as this approach will lead to inconsistent font sizes and line widths throughout your document.– leandriis
10 hours ago
add a comment |
2 Answers
2
active
oldest
votes
The immediate source of the error message is the line
multicolumn{3}{c|}{B} &
It should be
multicolumn{3}{c|}{B} \
Two additional observations:
multicolumn{}{|c||}{Dataset}
isn't correct either. It should be eithermulticolumn{1}{|c||}{Dataset}
or, much more simply,Dataset
.The option
[h!]
inbegin{tabular}[h!]
is meaningless and simply ignored. Valid options aret
("top"),c
("center" -- the default), andb
("bottom").
Addendum: If this were my table, I would strive hard to give it a much more open "look", mainly by omitting all vertical lines and using fewer, but well spaced, horizontal lines. There's no need for the resizebox
"sledge hammer". Use a tabular*
environment instead. I would also not bold-face the header cells, and I'd give more structure to the table's header material, and I'd align the numbers in the numerical columns on their respective decimal markers.
These ideas are implemented in the second table below.
documentclass{article}
usepackage{graphicx}
usepackage{booktabs,siunitx}
begin{document}
begin{table}[h!]
resizebox{5in}{!}{%
begin{tabular}[h!]{|c||c|c|c||c|c|c|}
hline
Dataset &
multicolumn{3}{c||}{A} &
multicolumn{3}{c|}{B} \
hline
bfseries Year & bfseries parameter &
bfseries gof & bfseries p-value &
bfseries parameter & bfseries gof &
bfseries p-value \
hline
1998 & 1.2661 & 0.4046 & 0.57 & 1.2889 & 0.3214 & 0.7 \ hline
1999 & 1.2685 & 0.4049 & 0.58 & 1.2913 & 0.3225 & 0.71 \ hline
2000 & 1.2681 & 0.4053 & 0.57 & 1.2942 & 0.321 & 0.71 \ hline
2001 & 1.2679 & 0.4082 & 0.56 & 1.2896 & 0.3208 & 0.71 \ hline
2002 & 1.2666 & 0.4098 & 0.55 & 1.2907 & 0.321 & 0.71 \ hline
2003 & 1.2673 & 0.4096 & 0.55 & 1.2849 & 0.3203 & 0.71 \ hline
2004 & 1.2678 & 0.409 & 0.57 & 1.2866 & 0.3187 & 0.72 \ hline
end{tabular}
}% end of scope of resizebox instruction
caption[stuff]{morestuff}
label{table:all.models}
end{table}
begin{table}[h!]
setlengthtabcolsep{0pt}
begin{tabular*}{5in}{@{extracolsep{fill}} l
*{2}{*{2}{S[table-format=1.4]}S[table-format=1.2]} }
toprule
Year & multicolumn{6}{c}{Dataset} \
cmidrule{2-7}
& multicolumn{3}{c}{A} & multicolumn{3}{c}{B} \
cmidrule{2-4} cmidrule{5-7}
& {Parameter} & {gof} & {p-value} & {Parameter} & {gof} & {p-value} \
midrule
1998 & 1.2661 & 0.4046 & 0.57 & 1.2889 & 0.3214 & 0.7 \
1999 & 1.2685 & 0.4049 & 0.58 & 1.2913 & 0.3225 & 0.71 \
2000 & 1.2681 & 0.4053 & 0.57 & 1.2942 & 0.321 & 0.71 \
2001 & 1.2679 & 0.4082 & 0.56 & 1.2896 & 0.3208 & 0.71 \
2002 & 1.2666 & 0.4098 & 0.55 & 1.2907 & 0.321 & 0.71 \
2003 & 1.2673 & 0.4096 & 0.55 & 1.2849 & 0.3203 & 0.71 \
2004 & 1.2678 & 0.409 & 0.57 & 1.2866 & 0.3187 & 0.72 \ bottomrule
end{tabular*}
caption{A much more ``open'' look}
label{table:another_look}
end{table}
end{document}
add a comment |
Off-topic:
I would design your table on the following way:
(red lines indicate text borders)
documentclass{article}
usepackage{booktabs, % for nicer horizontal rules (toprule, cmidrule, midrule,bottomrule)
makecell} % for column headers (thesd)
renewcommandtheadfont{bfseriessmall}
renewcommandtheadgape{}
usepackage{siunitx} % for S column type: numbers are aligned at decimal points
begin{document}
begin{table}[h!]
setlengthtabcolsep{0pt}
begin{tabular*}{linewidth}{@{extracolsep{fill}}
c
*{2}{S[table-format=1.4]}
S[table-format=1.2]
*{2}{S[table-format=1.4]}
S[table-format=1.2]
}
toprule
Dataset & multicolumn{3}{c}{A} & multicolumn{3}{c}{B} \
cmidrule{2-4}cmidrule{5-7}
thead{Year} & {thead{parameter}} & {thead{gof}} & {thead{p-value}}
& {thead{parameter}} & {thead{gof}} & {thead{p-value}} \
midrule
1998 & 1.2661 & 0.4046 & 0.57 & 1.2889 & 0.3214 & 0.7 \
1999 & 1.2685 & 0.4049 & 0.58 & 1.2913 & 0.3225 & 0.71 \
2000 & 1.2681 & 0.4053 & 0.57 & 1.2942 & 0.321 & 0.71 \
2001 & 1.2679 & 0.4082 & 0.56 & 1.2896 & 0.3208 & 0.71 \
2002 & 1.2666 & 0.4098 & 0.55 & 1.2907 & 0.321 & 0.71 \
2003 & 1.2673 & 0.4096 & 0.55 & 1.2849 & 0.3203 & 0.71 \
2004 & 1.2678 & 0.409 & 0.57 & 1.2866 & 0.3187 & 0.72 \
bottomrule
end{tabular*}
caption[stuff]{morestuff}
label{table:all.models}
end{table}
end{document}
That looks clean! Thank you. I'll use it!
– Joseph
10 hours ago
@Joseph, I'm glad to help you. Of course, you can up-vote answer if you liked it ;-)
– Zarko
10 hours ago
Done! :) Thank you!
– Joseph
10 hours 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%2f479154%2fextra-alignment-tab-has-been-changed-to-cr-using-table-tabular-and-resizebo%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
The immediate source of the error message is the line
multicolumn{3}{c|}{B} &
It should be
multicolumn{3}{c|}{B} \
Two additional observations:
multicolumn{}{|c||}{Dataset}
isn't correct either. It should be eithermulticolumn{1}{|c||}{Dataset}
or, much more simply,Dataset
.The option
[h!]
inbegin{tabular}[h!]
is meaningless and simply ignored. Valid options aret
("top"),c
("center" -- the default), andb
("bottom").
Addendum: If this were my table, I would strive hard to give it a much more open "look", mainly by omitting all vertical lines and using fewer, but well spaced, horizontal lines. There's no need for the resizebox
"sledge hammer". Use a tabular*
environment instead. I would also not bold-face the header cells, and I'd give more structure to the table's header material, and I'd align the numbers in the numerical columns on their respective decimal markers.
These ideas are implemented in the second table below.
documentclass{article}
usepackage{graphicx}
usepackage{booktabs,siunitx}
begin{document}
begin{table}[h!]
resizebox{5in}{!}{%
begin{tabular}[h!]{|c||c|c|c||c|c|c|}
hline
Dataset &
multicolumn{3}{c||}{A} &
multicolumn{3}{c|}{B} \
hline
bfseries Year & bfseries parameter &
bfseries gof & bfseries p-value &
bfseries parameter & bfseries gof &
bfseries p-value \
hline
1998 & 1.2661 & 0.4046 & 0.57 & 1.2889 & 0.3214 & 0.7 \ hline
1999 & 1.2685 & 0.4049 & 0.58 & 1.2913 & 0.3225 & 0.71 \ hline
2000 & 1.2681 & 0.4053 & 0.57 & 1.2942 & 0.321 & 0.71 \ hline
2001 & 1.2679 & 0.4082 & 0.56 & 1.2896 & 0.3208 & 0.71 \ hline
2002 & 1.2666 & 0.4098 & 0.55 & 1.2907 & 0.321 & 0.71 \ hline
2003 & 1.2673 & 0.4096 & 0.55 & 1.2849 & 0.3203 & 0.71 \ hline
2004 & 1.2678 & 0.409 & 0.57 & 1.2866 & 0.3187 & 0.72 \ hline
end{tabular}
}% end of scope of resizebox instruction
caption[stuff]{morestuff}
label{table:all.models}
end{table}
begin{table}[h!]
setlengthtabcolsep{0pt}
begin{tabular*}{5in}{@{extracolsep{fill}} l
*{2}{*{2}{S[table-format=1.4]}S[table-format=1.2]} }
toprule
Year & multicolumn{6}{c}{Dataset} \
cmidrule{2-7}
& multicolumn{3}{c}{A} & multicolumn{3}{c}{B} \
cmidrule{2-4} cmidrule{5-7}
& {Parameter} & {gof} & {p-value} & {Parameter} & {gof} & {p-value} \
midrule
1998 & 1.2661 & 0.4046 & 0.57 & 1.2889 & 0.3214 & 0.7 \
1999 & 1.2685 & 0.4049 & 0.58 & 1.2913 & 0.3225 & 0.71 \
2000 & 1.2681 & 0.4053 & 0.57 & 1.2942 & 0.321 & 0.71 \
2001 & 1.2679 & 0.4082 & 0.56 & 1.2896 & 0.3208 & 0.71 \
2002 & 1.2666 & 0.4098 & 0.55 & 1.2907 & 0.321 & 0.71 \
2003 & 1.2673 & 0.4096 & 0.55 & 1.2849 & 0.3203 & 0.71 \
2004 & 1.2678 & 0.409 & 0.57 & 1.2866 & 0.3187 & 0.72 \ bottomrule
end{tabular*}
caption{A much more ``open'' look}
label{table:another_look}
end{table}
end{document}
add a comment |
The immediate source of the error message is the line
multicolumn{3}{c|}{B} &
It should be
multicolumn{3}{c|}{B} \
Two additional observations:
multicolumn{}{|c||}{Dataset}
isn't correct either. It should be eithermulticolumn{1}{|c||}{Dataset}
or, much more simply,Dataset
.The option
[h!]
inbegin{tabular}[h!]
is meaningless and simply ignored. Valid options aret
("top"),c
("center" -- the default), andb
("bottom").
Addendum: If this were my table, I would strive hard to give it a much more open "look", mainly by omitting all vertical lines and using fewer, but well spaced, horizontal lines. There's no need for the resizebox
"sledge hammer". Use a tabular*
environment instead. I would also not bold-face the header cells, and I'd give more structure to the table's header material, and I'd align the numbers in the numerical columns on their respective decimal markers.
These ideas are implemented in the second table below.
documentclass{article}
usepackage{graphicx}
usepackage{booktabs,siunitx}
begin{document}
begin{table}[h!]
resizebox{5in}{!}{%
begin{tabular}[h!]{|c||c|c|c||c|c|c|}
hline
Dataset &
multicolumn{3}{c||}{A} &
multicolumn{3}{c|}{B} \
hline
bfseries Year & bfseries parameter &
bfseries gof & bfseries p-value &
bfseries parameter & bfseries gof &
bfseries p-value \
hline
1998 & 1.2661 & 0.4046 & 0.57 & 1.2889 & 0.3214 & 0.7 \ hline
1999 & 1.2685 & 0.4049 & 0.58 & 1.2913 & 0.3225 & 0.71 \ hline
2000 & 1.2681 & 0.4053 & 0.57 & 1.2942 & 0.321 & 0.71 \ hline
2001 & 1.2679 & 0.4082 & 0.56 & 1.2896 & 0.3208 & 0.71 \ hline
2002 & 1.2666 & 0.4098 & 0.55 & 1.2907 & 0.321 & 0.71 \ hline
2003 & 1.2673 & 0.4096 & 0.55 & 1.2849 & 0.3203 & 0.71 \ hline
2004 & 1.2678 & 0.409 & 0.57 & 1.2866 & 0.3187 & 0.72 \ hline
end{tabular}
}% end of scope of resizebox instruction
caption[stuff]{morestuff}
label{table:all.models}
end{table}
begin{table}[h!]
setlengthtabcolsep{0pt}
begin{tabular*}{5in}{@{extracolsep{fill}} l
*{2}{*{2}{S[table-format=1.4]}S[table-format=1.2]} }
toprule
Year & multicolumn{6}{c}{Dataset} \
cmidrule{2-7}
& multicolumn{3}{c}{A} & multicolumn{3}{c}{B} \
cmidrule{2-4} cmidrule{5-7}
& {Parameter} & {gof} & {p-value} & {Parameter} & {gof} & {p-value} \
midrule
1998 & 1.2661 & 0.4046 & 0.57 & 1.2889 & 0.3214 & 0.7 \
1999 & 1.2685 & 0.4049 & 0.58 & 1.2913 & 0.3225 & 0.71 \
2000 & 1.2681 & 0.4053 & 0.57 & 1.2942 & 0.321 & 0.71 \
2001 & 1.2679 & 0.4082 & 0.56 & 1.2896 & 0.3208 & 0.71 \
2002 & 1.2666 & 0.4098 & 0.55 & 1.2907 & 0.321 & 0.71 \
2003 & 1.2673 & 0.4096 & 0.55 & 1.2849 & 0.3203 & 0.71 \
2004 & 1.2678 & 0.409 & 0.57 & 1.2866 & 0.3187 & 0.72 \ bottomrule
end{tabular*}
caption{A much more ``open'' look}
label{table:another_look}
end{table}
end{document}
add a comment |
The immediate source of the error message is the line
multicolumn{3}{c|}{B} &
It should be
multicolumn{3}{c|}{B} \
Two additional observations:
multicolumn{}{|c||}{Dataset}
isn't correct either. It should be eithermulticolumn{1}{|c||}{Dataset}
or, much more simply,Dataset
.The option
[h!]
inbegin{tabular}[h!]
is meaningless and simply ignored. Valid options aret
("top"),c
("center" -- the default), andb
("bottom").
Addendum: If this were my table, I would strive hard to give it a much more open "look", mainly by omitting all vertical lines and using fewer, but well spaced, horizontal lines. There's no need for the resizebox
"sledge hammer". Use a tabular*
environment instead. I would also not bold-face the header cells, and I'd give more structure to the table's header material, and I'd align the numbers in the numerical columns on their respective decimal markers.
These ideas are implemented in the second table below.
documentclass{article}
usepackage{graphicx}
usepackage{booktabs,siunitx}
begin{document}
begin{table}[h!]
resizebox{5in}{!}{%
begin{tabular}[h!]{|c||c|c|c||c|c|c|}
hline
Dataset &
multicolumn{3}{c||}{A} &
multicolumn{3}{c|}{B} \
hline
bfseries Year & bfseries parameter &
bfseries gof & bfseries p-value &
bfseries parameter & bfseries gof &
bfseries p-value \
hline
1998 & 1.2661 & 0.4046 & 0.57 & 1.2889 & 0.3214 & 0.7 \ hline
1999 & 1.2685 & 0.4049 & 0.58 & 1.2913 & 0.3225 & 0.71 \ hline
2000 & 1.2681 & 0.4053 & 0.57 & 1.2942 & 0.321 & 0.71 \ hline
2001 & 1.2679 & 0.4082 & 0.56 & 1.2896 & 0.3208 & 0.71 \ hline
2002 & 1.2666 & 0.4098 & 0.55 & 1.2907 & 0.321 & 0.71 \ hline
2003 & 1.2673 & 0.4096 & 0.55 & 1.2849 & 0.3203 & 0.71 \ hline
2004 & 1.2678 & 0.409 & 0.57 & 1.2866 & 0.3187 & 0.72 \ hline
end{tabular}
}% end of scope of resizebox instruction
caption[stuff]{morestuff}
label{table:all.models}
end{table}
begin{table}[h!]
setlengthtabcolsep{0pt}
begin{tabular*}{5in}{@{extracolsep{fill}} l
*{2}{*{2}{S[table-format=1.4]}S[table-format=1.2]} }
toprule
Year & multicolumn{6}{c}{Dataset} \
cmidrule{2-7}
& multicolumn{3}{c}{A} & multicolumn{3}{c}{B} \
cmidrule{2-4} cmidrule{5-7}
& {Parameter} & {gof} & {p-value} & {Parameter} & {gof} & {p-value} \
midrule
1998 & 1.2661 & 0.4046 & 0.57 & 1.2889 & 0.3214 & 0.7 \
1999 & 1.2685 & 0.4049 & 0.58 & 1.2913 & 0.3225 & 0.71 \
2000 & 1.2681 & 0.4053 & 0.57 & 1.2942 & 0.321 & 0.71 \
2001 & 1.2679 & 0.4082 & 0.56 & 1.2896 & 0.3208 & 0.71 \
2002 & 1.2666 & 0.4098 & 0.55 & 1.2907 & 0.321 & 0.71 \
2003 & 1.2673 & 0.4096 & 0.55 & 1.2849 & 0.3203 & 0.71 \
2004 & 1.2678 & 0.409 & 0.57 & 1.2866 & 0.3187 & 0.72 \ bottomrule
end{tabular*}
caption{A much more ``open'' look}
label{table:another_look}
end{table}
end{document}
The immediate source of the error message is the line
multicolumn{3}{c|}{B} &
It should be
multicolumn{3}{c|}{B} \
Two additional observations:
multicolumn{}{|c||}{Dataset}
isn't correct either. It should be eithermulticolumn{1}{|c||}{Dataset}
or, much more simply,Dataset
.The option
[h!]
inbegin{tabular}[h!]
is meaningless and simply ignored. Valid options aret
("top"),c
("center" -- the default), andb
("bottom").
Addendum: If this were my table, I would strive hard to give it a much more open "look", mainly by omitting all vertical lines and using fewer, but well spaced, horizontal lines. There's no need for the resizebox
"sledge hammer". Use a tabular*
environment instead. I would also not bold-face the header cells, and I'd give more structure to the table's header material, and I'd align the numbers in the numerical columns on their respective decimal markers.
These ideas are implemented in the second table below.
documentclass{article}
usepackage{graphicx}
usepackage{booktabs,siunitx}
begin{document}
begin{table}[h!]
resizebox{5in}{!}{%
begin{tabular}[h!]{|c||c|c|c||c|c|c|}
hline
Dataset &
multicolumn{3}{c||}{A} &
multicolumn{3}{c|}{B} \
hline
bfseries Year & bfseries parameter &
bfseries gof & bfseries p-value &
bfseries parameter & bfseries gof &
bfseries p-value \
hline
1998 & 1.2661 & 0.4046 & 0.57 & 1.2889 & 0.3214 & 0.7 \ hline
1999 & 1.2685 & 0.4049 & 0.58 & 1.2913 & 0.3225 & 0.71 \ hline
2000 & 1.2681 & 0.4053 & 0.57 & 1.2942 & 0.321 & 0.71 \ hline
2001 & 1.2679 & 0.4082 & 0.56 & 1.2896 & 0.3208 & 0.71 \ hline
2002 & 1.2666 & 0.4098 & 0.55 & 1.2907 & 0.321 & 0.71 \ hline
2003 & 1.2673 & 0.4096 & 0.55 & 1.2849 & 0.3203 & 0.71 \ hline
2004 & 1.2678 & 0.409 & 0.57 & 1.2866 & 0.3187 & 0.72 \ hline
end{tabular}
}% end of scope of resizebox instruction
caption[stuff]{morestuff}
label{table:all.models}
end{table}
begin{table}[h!]
setlengthtabcolsep{0pt}
begin{tabular*}{5in}{@{extracolsep{fill}} l
*{2}{*{2}{S[table-format=1.4]}S[table-format=1.2]} }
toprule
Year & multicolumn{6}{c}{Dataset} \
cmidrule{2-7}
& multicolumn{3}{c}{A} & multicolumn{3}{c}{B} \
cmidrule{2-4} cmidrule{5-7}
& {Parameter} & {gof} & {p-value} & {Parameter} & {gof} & {p-value} \
midrule
1998 & 1.2661 & 0.4046 & 0.57 & 1.2889 & 0.3214 & 0.7 \
1999 & 1.2685 & 0.4049 & 0.58 & 1.2913 & 0.3225 & 0.71 \
2000 & 1.2681 & 0.4053 & 0.57 & 1.2942 & 0.321 & 0.71 \
2001 & 1.2679 & 0.4082 & 0.56 & 1.2896 & 0.3208 & 0.71 \
2002 & 1.2666 & 0.4098 & 0.55 & 1.2907 & 0.321 & 0.71 \
2003 & 1.2673 & 0.4096 & 0.55 & 1.2849 & 0.3203 & 0.71 \
2004 & 1.2678 & 0.409 & 0.57 & 1.2866 & 0.3187 & 0.72 \ bottomrule
end{tabular*}
caption{A much more ``open'' look}
label{table:another_look}
end{table}
end{document}
edited 10 hours ago
answered 10 hours ago
MicoMico
282k31386774
282k31386774
add a comment |
add a comment |
Off-topic:
I would design your table on the following way:
(red lines indicate text borders)
documentclass{article}
usepackage{booktabs, % for nicer horizontal rules (toprule, cmidrule, midrule,bottomrule)
makecell} % for column headers (thesd)
renewcommandtheadfont{bfseriessmall}
renewcommandtheadgape{}
usepackage{siunitx} % for S column type: numbers are aligned at decimal points
begin{document}
begin{table}[h!]
setlengthtabcolsep{0pt}
begin{tabular*}{linewidth}{@{extracolsep{fill}}
c
*{2}{S[table-format=1.4]}
S[table-format=1.2]
*{2}{S[table-format=1.4]}
S[table-format=1.2]
}
toprule
Dataset & multicolumn{3}{c}{A} & multicolumn{3}{c}{B} \
cmidrule{2-4}cmidrule{5-7}
thead{Year} & {thead{parameter}} & {thead{gof}} & {thead{p-value}}
& {thead{parameter}} & {thead{gof}} & {thead{p-value}} \
midrule
1998 & 1.2661 & 0.4046 & 0.57 & 1.2889 & 0.3214 & 0.7 \
1999 & 1.2685 & 0.4049 & 0.58 & 1.2913 & 0.3225 & 0.71 \
2000 & 1.2681 & 0.4053 & 0.57 & 1.2942 & 0.321 & 0.71 \
2001 & 1.2679 & 0.4082 & 0.56 & 1.2896 & 0.3208 & 0.71 \
2002 & 1.2666 & 0.4098 & 0.55 & 1.2907 & 0.321 & 0.71 \
2003 & 1.2673 & 0.4096 & 0.55 & 1.2849 & 0.3203 & 0.71 \
2004 & 1.2678 & 0.409 & 0.57 & 1.2866 & 0.3187 & 0.72 \
bottomrule
end{tabular*}
caption[stuff]{morestuff}
label{table:all.models}
end{table}
end{document}
That looks clean! Thank you. I'll use it!
– Joseph
10 hours ago
@Joseph, I'm glad to help you. Of course, you can up-vote answer if you liked it ;-)
– Zarko
10 hours ago
Done! :) Thank you!
– Joseph
10 hours ago
add a comment |
Off-topic:
I would design your table on the following way:
(red lines indicate text borders)
documentclass{article}
usepackage{booktabs, % for nicer horizontal rules (toprule, cmidrule, midrule,bottomrule)
makecell} % for column headers (thesd)
renewcommandtheadfont{bfseriessmall}
renewcommandtheadgape{}
usepackage{siunitx} % for S column type: numbers are aligned at decimal points
begin{document}
begin{table}[h!]
setlengthtabcolsep{0pt}
begin{tabular*}{linewidth}{@{extracolsep{fill}}
c
*{2}{S[table-format=1.4]}
S[table-format=1.2]
*{2}{S[table-format=1.4]}
S[table-format=1.2]
}
toprule
Dataset & multicolumn{3}{c}{A} & multicolumn{3}{c}{B} \
cmidrule{2-4}cmidrule{5-7}
thead{Year} & {thead{parameter}} & {thead{gof}} & {thead{p-value}}
& {thead{parameter}} & {thead{gof}} & {thead{p-value}} \
midrule
1998 & 1.2661 & 0.4046 & 0.57 & 1.2889 & 0.3214 & 0.7 \
1999 & 1.2685 & 0.4049 & 0.58 & 1.2913 & 0.3225 & 0.71 \
2000 & 1.2681 & 0.4053 & 0.57 & 1.2942 & 0.321 & 0.71 \
2001 & 1.2679 & 0.4082 & 0.56 & 1.2896 & 0.3208 & 0.71 \
2002 & 1.2666 & 0.4098 & 0.55 & 1.2907 & 0.321 & 0.71 \
2003 & 1.2673 & 0.4096 & 0.55 & 1.2849 & 0.3203 & 0.71 \
2004 & 1.2678 & 0.409 & 0.57 & 1.2866 & 0.3187 & 0.72 \
bottomrule
end{tabular*}
caption[stuff]{morestuff}
label{table:all.models}
end{table}
end{document}
That looks clean! Thank you. I'll use it!
– Joseph
10 hours ago
@Joseph, I'm glad to help you. Of course, you can up-vote answer if you liked it ;-)
– Zarko
10 hours ago
Done! :) Thank you!
– Joseph
10 hours ago
add a comment |
Off-topic:
I would design your table on the following way:
(red lines indicate text borders)
documentclass{article}
usepackage{booktabs, % for nicer horizontal rules (toprule, cmidrule, midrule,bottomrule)
makecell} % for column headers (thesd)
renewcommandtheadfont{bfseriessmall}
renewcommandtheadgape{}
usepackage{siunitx} % for S column type: numbers are aligned at decimal points
begin{document}
begin{table}[h!]
setlengthtabcolsep{0pt}
begin{tabular*}{linewidth}{@{extracolsep{fill}}
c
*{2}{S[table-format=1.4]}
S[table-format=1.2]
*{2}{S[table-format=1.4]}
S[table-format=1.2]
}
toprule
Dataset & multicolumn{3}{c}{A} & multicolumn{3}{c}{B} \
cmidrule{2-4}cmidrule{5-7}
thead{Year} & {thead{parameter}} & {thead{gof}} & {thead{p-value}}
& {thead{parameter}} & {thead{gof}} & {thead{p-value}} \
midrule
1998 & 1.2661 & 0.4046 & 0.57 & 1.2889 & 0.3214 & 0.7 \
1999 & 1.2685 & 0.4049 & 0.58 & 1.2913 & 0.3225 & 0.71 \
2000 & 1.2681 & 0.4053 & 0.57 & 1.2942 & 0.321 & 0.71 \
2001 & 1.2679 & 0.4082 & 0.56 & 1.2896 & 0.3208 & 0.71 \
2002 & 1.2666 & 0.4098 & 0.55 & 1.2907 & 0.321 & 0.71 \
2003 & 1.2673 & 0.4096 & 0.55 & 1.2849 & 0.3203 & 0.71 \
2004 & 1.2678 & 0.409 & 0.57 & 1.2866 & 0.3187 & 0.72 \
bottomrule
end{tabular*}
caption[stuff]{morestuff}
label{table:all.models}
end{table}
end{document}
Off-topic:
I would design your table on the following way:
(red lines indicate text borders)
documentclass{article}
usepackage{booktabs, % for nicer horizontal rules (toprule, cmidrule, midrule,bottomrule)
makecell} % for column headers (thesd)
renewcommandtheadfont{bfseriessmall}
renewcommandtheadgape{}
usepackage{siunitx} % for S column type: numbers are aligned at decimal points
begin{document}
begin{table}[h!]
setlengthtabcolsep{0pt}
begin{tabular*}{linewidth}{@{extracolsep{fill}}
c
*{2}{S[table-format=1.4]}
S[table-format=1.2]
*{2}{S[table-format=1.4]}
S[table-format=1.2]
}
toprule
Dataset & multicolumn{3}{c}{A} & multicolumn{3}{c}{B} \
cmidrule{2-4}cmidrule{5-7}
thead{Year} & {thead{parameter}} & {thead{gof}} & {thead{p-value}}
& {thead{parameter}} & {thead{gof}} & {thead{p-value}} \
midrule
1998 & 1.2661 & 0.4046 & 0.57 & 1.2889 & 0.3214 & 0.7 \
1999 & 1.2685 & 0.4049 & 0.58 & 1.2913 & 0.3225 & 0.71 \
2000 & 1.2681 & 0.4053 & 0.57 & 1.2942 & 0.321 & 0.71 \
2001 & 1.2679 & 0.4082 & 0.56 & 1.2896 & 0.3208 & 0.71 \
2002 & 1.2666 & 0.4098 & 0.55 & 1.2907 & 0.321 & 0.71 \
2003 & 1.2673 & 0.4096 & 0.55 & 1.2849 & 0.3203 & 0.71 \
2004 & 1.2678 & 0.409 & 0.57 & 1.2866 & 0.3187 & 0.72 \
bottomrule
end{tabular*}
caption[stuff]{morestuff}
label{table:all.models}
end{table}
end{document}
answered 10 hours ago
ZarkoZarko
127k868166
127k868166
That looks clean! Thank you. I'll use it!
– Joseph
10 hours ago
@Joseph, I'm glad to help you. Of course, you can up-vote answer if you liked it ;-)
– Zarko
10 hours ago
Done! :) Thank you!
– Joseph
10 hours ago
add a comment |
That looks clean! Thank you. I'll use it!
– Joseph
10 hours ago
@Joseph, I'm glad to help you. Of course, you can up-vote answer if you liked it ;-)
– Zarko
10 hours ago
Done! :) Thank you!
– Joseph
10 hours ago
That looks clean! Thank you. I'll use it!
– Joseph
10 hours ago
That looks clean! Thank you. I'll use it!
– Joseph
10 hours ago
@Joseph, I'm glad to help you. Of course, you can up-vote answer if you liked it ;-)
– Zarko
10 hours ago
@Joseph, I'm glad to help you. Of course, you can up-vote answer if you liked it ;-)
– Zarko
10 hours ago
Done! :) Thank you!
– Joseph
10 hours ago
Done! :) Thank you!
– Joseph
10 hours 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%2f479154%2fextra-alignment-tab-has-been-changed-to-cr-using-table-tabular-and-resizebo%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 instruction
multicolumn{}{|c||}{Dataset}
generates a syntax error. Did you mean to writemulticolumn{1}{|c||}{Dataset}
?– Mico
10 hours ago
THANK YOU!! You're awesome!
– Joseph
10 hours ago
1
You might alos consider not using
resizebox
in order to make the table occupy a certain space as this approach will lead to inconsistent font sizes and line widths throughout your document.– leandriis
10 hours ago