How to improve this table?
I'm looking for ideas to improve the layout of the following table.
- Is there a better way to separate ABC Metrics and XYZ Metrics (other than using separate table for each metric)?
- Should I convert Algorithms row into a column?
- Should I convert Dataset row into a column?
I would appreciate any ideas, thanks.
documentclass{article}
usepackage[margin=1in]{geometry}
usepackage{tabularx,ragged2e,booktabs}
begin{document}
begin{table*}[!ht]
caption{Evaluation results}
centering
setlength{tabcolsep}{4pt}
begin{tabularx}{textwidth}{>{hsize=1.9hsizebfseriesRaggedRight}X!{extracolsep{fill}}*{6}{>{centeringarraybackslashhsize=0.48hsize}X}}
toprule[1pt]midrule[0.3pt]
multicolumn{7}{c}{textbf{ABC Metrics}} \ midrule[0.3pt]
textbf{Algorithm}& multicolumn{2}{c}{textit{Algo 1}} & multicolumn{2}{c}{textit{Algo 2}} & multicolumn{2}{c}{textit{Algo 3}} \
cmidrule(lr){2-3} cmidrule(lr){4-5} cmidrule(lr){6-7}%
{Dataset} & $D_1$ & $D_2$ & $D_1$ & $D_2$ & $D_1$ & $D_2$ \
addlinespace%
{Matric 1} & 0 & 0 & 0 & 0 & 0 & 0 \
addlinespace%
{Matric 2} & 0 & 0 & 0 & 0 & 0 & 0 \
addlinespace%
{Matric 3} & 0 & 0 & 0 & 0 & 0 & 0 \
addlinespace
{Matric 4} & 0 & 0 & 0 & 0 & 0 & 0 \
midrule
multicolumn{7}{c}{textbf{XYZ Metrics}} \ midrule[0.3pt]
textbf{Algorithm}& multicolumn{2}{c}{textit{Algo 1}} & multicolumn{2}{c}{textit{Algo 2}} & multicolumn{2}{c}{textit{Algo 3}} \
cmidrule(lr){2-3} cmidrule(lr){4-5} cmidrule(lr){6-7}%
{Matric 5} & multicolumn{2}{c}{0} & multicolumn{2}{c}{0} & multicolumn{2}{c}{0} \ addlinespace
{Matric 6} & multicolumn{2}{c}{0} & multicolumn{2}{c}{0} & multicolumn{2}{c}{0} \
midrule[0.3pt]bottomrule[1pt]
end{tabularx}
end{table*}
end{document}
tables tabularx booktabs
add a comment |
I'm looking for ideas to improve the layout of the following table.
- Is there a better way to separate ABC Metrics and XYZ Metrics (other than using separate table for each metric)?
- Should I convert Algorithms row into a column?
- Should I convert Dataset row into a column?
I would appreciate any ideas, thanks.
documentclass{article}
usepackage[margin=1in]{geometry}
usepackage{tabularx,ragged2e,booktabs}
begin{document}
begin{table*}[!ht]
caption{Evaluation results}
centering
setlength{tabcolsep}{4pt}
begin{tabularx}{textwidth}{>{hsize=1.9hsizebfseriesRaggedRight}X!{extracolsep{fill}}*{6}{>{centeringarraybackslashhsize=0.48hsize}X}}
toprule[1pt]midrule[0.3pt]
multicolumn{7}{c}{textbf{ABC Metrics}} \ midrule[0.3pt]
textbf{Algorithm}& multicolumn{2}{c}{textit{Algo 1}} & multicolumn{2}{c}{textit{Algo 2}} & multicolumn{2}{c}{textit{Algo 3}} \
cmidrule(lr){2-3} cmidrule(lr){4-5} cmidrule(lr){6-7}%
{Dataset} & $D_1$ & $D_2$ & $D_1$ & $D_2$ & $D_1$ & $D_2$ \
addlinespace%
{Matric 1} & 0 & 0 & 0 & 0 & 0 & 0 \
addlinespace%
{Matric 2} & 0 & 0 & 0 & 0 & 0 & 0 \
addlinespace%
{Matric 3} & 0 & 0 & 0 & 0 & 0 & 0 \
addlinespace
{Matric 4} & 0 & 0 & 0 & 0 & 0 & 0 \
midrule
multicolumn{7}{c}{textbf{XYZ Metrics}} \ midrule[0.3pt]
textbf{Algorithm}& multicolumn{2}{c}{textit{Algo 1}} & multicolumn{2}{c}{textit{Algo 2}} & multicolumn{2}{c}{textit{Algo 3}} \
cmidrule(lr){2-3} cmidrule(lr){4-5} cmidrule(lr){6-7}%
{Matric 5} & multicolumn{2}{c}{0} & multicolumn{2}{c}{0} & multicolumn{2}{c}{0} \ addlinespace
{Matric 6} & multicolumn{2}{c}{0} & multicolumn{2}{c}{0} & multicolumn{2}{c}{0} \
midrule[0.3pt]bottomrule[1pt]
end{tabularx}
end{table*}
end{document}
tables tabularx booktabs
2
I think this is off-topic because it is subjective. You should ask how to make changes to a table, not opinions on what improvements can you do.
– manooooh
Jan 3 at 2:24
4
@manooooh That's actually a good question for Meta, whether code review questions are accepted here.
– Henri Menke
Jan 3 at 4:42
@HenriMenke: See Tagging "Please improve my code" posts and To what extent are code-review-style questions welcome?
– Werner
Jan 3 at 5:55
add a comment |
I'm looking for ideas to improve the layout of the following table.
- Is there a better way to separate ABC Metrics and XYZ Metrics (other than using separate table for each metric)?
- Should I convert Algorithms row into a column?
- Should I convert Dataset row into a column?
I would appreciate any ideas, thanks.
documentclass{article}
usepackage[margin=1in]{geometry}
usepackage{tabularx,ragged2e,booktabs}
begin{document}
begin{table*}[!ht]
caption{Evaluation results}
centering
setlength{tabcolsep}{4pt}
begin{tabularx}{textwidth}{>{hsize=1.9hsizebfseriesRaggedRight}X!{extracolsep{fill}}*{6}{>{centeringarraybackslashhsize=0.48hsize}X}}
toprule[1pt]midrule[0.3pt]
multicolumn{7}{c}{textbf{ABC Metrics}} \ midrule[0.3pt]
textbf{Algorithm}& multicolumn{2}{c}{textit{Algo 1}} & multicolumn{2}{c}{textit{Algo 2}} & multicolumn{2}{c}{textit{Algo 3}} \
cmidrule(lr){2-3} cmidrule(lr){4-5} cmidrule(lr){6-7}%
{Dataset} & $D_1$ & $D_2$ & $D_1$ & $D_2$ & $D_1$ & $D_2$ \
addlinespace%
{Matric 1} & 0 & 0 & 0 & 0 & 0 & 0 \
addlinespace%
{Matric 2} & 0 & 0 & 0 & 0 & 0 & 0 \
addlinespace%
{Matric 3} & 0 & 0 & 0 & 0 & 0 & 0 \
addlinespace
{Matric 4} & 0 & 0 & 0 & 0 & 0 & 0 \
midrule
multicolumn{7}{c}{textbf{XYZ Metrics}} \ midrule[0.3pt]
textbf{Algorithm}& multicolumn{2}{c}{textit{Algo 1}} & multicolumn{2}{c}{textit{Algo 2}} & multicolumn{2}{c}{textit{Algo 3}} \
cmidrule(lr){2-3} cmidrule(lr){4-5} cmidrule(lr){6-7}%
{Matric 5} & multicolumn{2}{c}{0} & multicolumn{2}{c}{0} & multicolumn{2}{c}{0} \ addlinespace
{Matric 6} & multicolumn{2}{c}{0} & multicolumn{2}{c}{0} & multicolumn{2}{c}{0} \
midrule[0.3pt]bottomrule[1pt]
end{tabularx}
end{table*}
end{document}
tables tabularx booktabs
I'm looking for ideas to improve the layout of the following table.
- Is there a better way to separate ABC Metrics and XYZ Metrics (other than using separate table for each metric)?
- Should I convert Algorithms row into a column?
- Should I convert Dataset row into a column?
I would appreciate any ideas, thanks.
documentclass{article}
usepackage[margin=1in]{geometry}
usepackage{tabularx,ragged2e,booktabs}
begin{document}
begin{table*}[!ht]
caption{Evaluation results}
centering
setlength{tabcolsep}{4pt}
begin{tabularx}{textwidth}{>{hsize=1.9hsizebfseriesRaggedRight}X!{extracolsep{fill}}*{6}{>{centeringarraybackslashhsize=0.48hsize}X}}
toprule[1pt]midrule[0.3pt]
multicolumn{7}{c}{textbf{ABC Metrics}} \ midrule[0.3pt]
textbf{Algorithm}& multicolumn{2}{c}{textit{Algo 1}} & multicolumn{2}{c}{textit{Algo 2}} & multicolumn{2}{c}{textit{Algo 3}} \
cmidrule(lr){2-3} cmidrule(lr){4-5} cmidrule(lr){6-7}%
{Dataset} & $D_1$ & $D_2$ & $D_1$ & $D_2$ & $D_1$ & $D_2$ \
addlinespace%
{Matric 1} & 0 & 0 & 0 & 0 & 0 & 0 \
addlinespace%
{Matric 2} & 0 & 0 & 0 & 0 & 0 & 0 \
addlinespace%
{Matric 3} & 0 & 0 & 0 & 0 & 0 & 0 \
addlinespace
{Matric 4} & 0 & 0 & 0 & 0 & 0 & 0 \
midrule
multicolumn{7}{c}{textbf{XYZ Metrics}} \ midrule[0.3pt]
textbf{Algorithm}& multicolumn{2}{c}{textit{Algo 1}} & multicolumn{2}{c}{textit{Algo 2}} & multicolumn{2}{c}{textit{Algo 3}} \
cmidrule(lr){2-3} cmidrule(lr){4-5} cmidrule(lr){6-7}%
{Matric 5} & multicolumn{2}{c}{0} & multicolumn{2}{c}{0} & multicolumn{2}{c}{0} \ addlinespace
{Matric 6} & multicolumn{2}{c}{0} & multicolumn{2}{c}{0} & multicolumn{2}{c}{0} \
midrule[0.3pt]bottomrule[1pt]
end{tabularx}
end{table*}
end{document}
tables tabularx booktabs
tables tabularx booktabs
asked Jan 3 at 2:16
user3140972user3140972
1263
1263
2
I think this is off-topic because it is subjective. You should ask how to make changes to a table, not opinions on what improvements can you do.
– manooooh
Jan 3 at 2:24
4
@manooooh That's actually a good question for Meta, whether code review questions are accepted here.
– Henri Menke
Jan 3 at 4:42
@HenriMenke: See Tagging "Please improve my code" posts and To what extent are code-review-style questions welcome?
– Werner
Jan 3 at 5:55
add a comment |
2
I think this is off-topic because it is subjective. You should ask how to make changes to a table, not opinions on what improvements can you do.
– manooooh
Jan 3 at 2:24
4
@manooooh That's actually a good question for Meta, whether code review questions are accepted here.
– Henri Menke
Jan 3 at 4:42
@HenriMenke: See Tagging "Please improve my code" posts and To what extent are code-review-style questions welcome?
– Werner
Jan 3 at 5:55
2
2
I think this is off-topic because it is subjective. You should ask how to make changes to a table, not opinions on what improvements can you do.
– manooooh
Jan 3 at 2:24
I think this is off-topic because it is subjective. You should ask how to make changes to a table, not opinions on what improvements can you do.
– manooooh
Jan 3 at 2:24
4
4
@manooooh That's actually a good question for Meta, whether code review questions are accepted here.
– Henri Menke
Jan 3 at 4:42
@manooooh That's actually a good question for Meta, whether code review questions are accepted here.
– Henri Menke
Jan 3 at 4:42
@HenriMenke: See Tagging "Please improve my code" posts and To what extent are code-review-style questions welcome?
– Werner
Jan 3 at 5:55
@HenriMenke: See Tagging "Please improve my code" posts and To what extent are code-review-style questions welcome?
– Werner
Jan 3 at 5:55
add a comment |
3 Answers
3
active
oldest
votes
i only repair some inconsistencies in your column width calculation. the sum of the defined widths is 4.78. but it should be an integer number. all other is opinion based ...
my suggestion for your table code (with some opinion based changes and simplification of writing) is:
documentclass{article}
usepackage[margin=1in]{geometry}
usepackage[skip=1ex]{caption}
usepackage{ragged2e}
usepackage{booktabs,tabularx}
newcommandmcc[1]{multicolumn{2}{c}{#1}}
begin{document}
begin{table}[!ht]
caption{Evaluation results}
centering
begin{tabularx}{textwidth}{
>{hsize=0.4hsizebfseriesRaggedRight}X
*{6}{>{hsize=0.1hsizecenteringarraybackslash}X}}
toprule
multicolumn{7}{c}{textbf{ABC Metrics}} \
midrule
textbf{Algorithm}
& mcc{textit{Algo 1}} & mcc{textit{Algo 2}} & mcc{textit{Algo 3}} \
cmidrule(lr){2-3} cmidrule(lr){4-5} cmidrule(lr){6-7}%
Dataset & $D_1$ & $D_2$ & $D_1$ & $D_2$ & $D_1$ & $D_2$ \
midrule
Matric 1 & 0 & 0 & 0 & 0 & 0 & 0 \
addlinespace%
Matric 2 & 0 & 0 & 0 & 0 & 0 & 0 \
addlinespace%
Matric 3 & 0 & 0 & 0 & 0 & 0 & 0 \
addlinespace
Matric 4 & 0 & 0 & 0 & 0 & 0 & 0 \
midrule
multicolumn{7}{c}{textbf{XYZ Metrics}} \ midrule[0.3pt]
textbf{Algorithm}
& mcc{textit{Algo 1}} & mcc{textit{Algo 2}} & mcc{textit{Algo 3}} \
cmidrule(lr){2-3} cmidrule(lr){4-5} cmidrule(lr){6-7}%
{Matric 5} & mcc{0} & mcc{0} & mcc{0} \
addlinespace
{Matric 6} & mcc{0} & mcc{0} & mcc{0} \
bottomrule
end{tabularx}
end{table}
end{document}
which gives:
add a comment |
Some general observations and comments:
I don't understand why you're using 1
tabularx
environment for two structures that don't look all that much connected. I'd use two separate environments.Since there appears to be no line-wrapping whatsoever, I don't understand why you'd be using a
tabularx
environment to begin with. Why not use atabular*
environment? For that matter, why not usetabular
environments?
Some more specific comments:
Using bold-facing and/or italics in the header cells is a transparent attempt to compensate for the lack of clear visual structure. With such an approach, you are mostly going to come across as somebody who (a) isn't particularly well organized and (b) thinks it's ok to shout at people. The people I know, though, very much prefer not to be shouted at. Your experience may differ...
Based on the information you've provided, the material can easily be presented in two separate, side-by-side
tabular
environments.
The following solution tries to present the material without any shouting, while still trying to be visually "open" and inviting.
PS. What's a "matric"?
documentclass{article}
usepackage[margin=1in,letterpaper]{geometry}
usepackage[skip=0.5baselineskip]{caption} % optional
usepackage{array,booktabs}
begin{document}
begin{table}[!ht]
setlengthtabcolsep{10pt} % default: 6pt
caption{Evaluation results}
begin{tabular}[t]{@{} l *{6}{c} @{}}
multicolumn{7}{@{}l}{ABC Metrics, for datasets $D_1$ and $D_2$} \
toprule
& multicolumn{6}{c@{}}{Algorithm}\
cmidrule(l){2-7}
& multicolumn{2}{c}{Algo 1}
& multicolumn{2}{c}{Algo 2}
& multicolumn{2}{c@{}}{Algo 3} \
cmidrule(lr){2-3} cmidrule(lr){4-5} cmidrule(l){6-7}
& $D_1$ & $D_2$ & $D_1$ & $D_2$ & $D_1$ & $D_2$ \
midrule
Matric 1 & 0 & 0 & 0 & 0 & 0 & 0 \
Matric 2 & 0 & 0 & 0 & 0 & 0 & 0 \
Matric 3 & 0 & 0 & 0 & 0 & 0 & 0 \
Matric 4 & 0 & 0 & 0 & 0 & 0 & 0 \
bottomrule
end{tabular}
hspace{fill}
begin{tabular}[t]{@{} l ccc @{}}
multicolumn{4}{@{}l}{XYZ Metrics} \
toprule
& multicolumn{3}{c@{}}{Algorithm}\
cmidrule(l){2-4}
& Algo 1 & Algo 2 & Algo 3 \
midrule
Matric 5 & 0 & 0 & 0 \
Matric 6 & 0 & 0 & 0 \
bottomrule
end{tabular}
end{table}
end{document}
add a comment |
I propose this variant layout, with correct coefficients fòr hsize=
:
documentclass{article}
usepackage[margin=1in]{geometry}
usepackage[skip=1ex]{caption}
usepackage[table, svgnames]{xcolor}
usepackage{ragged2e}
usepackage{booktabs,tabularx}
newcommandmcc[1]{multicolumn{2}{c}{#1}}
begin{document}
begin{table}[!ht]
caption{Evaluation results}
centering
setlength{extrarowheight}{2pt}
setlength{belowrulesep}{0pt}
begin{tabularx}{textwidth}{
>{hsize=2.8hsizebfseriesRaggedRight}X
*{6}{>{hsize=0.7hsizecenteringarraybackslash}X}}
toprule
& multicolumn{6}{c}{textbf{Algorithm}} \
cmidrule{2-7}
& mcc{textit{Algo 1}} & mcc{textit{Algo 2}} & mcc{textit{Algo 3}} \
rowcolor{WhiteSmoke} ABC Metricshfill Dataset & $D₁$ & $D₂$ & $D₁$ & $D₂$ & $D₁$ & $D₂$ \
addlinespace
Metric 1 & 0 & 0 & 0 & 0 & 0 & 0 \
addlinespace%
Metric 2 & 0 & 0 & 0 & 0 & 0 & 0 \
addlinespace%
Metric 3 & 0 & 0 & 0 & 0 & 0 & 0 \
addlinespace
Metric 4 & 0 & 0 & 0 & 0 & 0 & 0 \
addlinespace
rowcolor{WhiteSmoke} XYZ Metrics & & & & & & \
addlinespace
{Metric 5} & mcc{0} & mcc{0} & mcc{0} \
addlinespace
{Metric 6} & mcc{0} & mcc{0} & mcc{0} \
bottomrule
end{tabularx}
end{table}
end{document}
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%2f468355%2fhow-to-improve-this-table%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
i only repair some inconsistencies in your column width calculation. the sum of the defined widths is 4.78. but it should be an integer number. all other is opinion based ...
my suggestion for your table code (with some opinion based changes and simplification of writing) is:
documentclass{article}
usepackage[margin=1in]{geometry}
usepackage[skip=1ex]{caption}
usepackage{ragged2e}
usepackage{booktabs,tabularx}
newcommandmcc[1]{multicolumn{2}{c}{#1}}
begin{document}
begin{table}[!ht]
caption{Evaluation results}
centering
begin{tabularx}{textwidth}{
>{hsize=0.4hsizebfseriesRaggedRight}X
*{6}{>{hsize=0.1hsizecenteringarraybackslash}X}}
toprule
multicolumn{7}{c}{textbf{ABC Metrics}} \
midrule
textbf{Algorithm}
& mcc{textit{Algo 1}} & mcc{textit{Algo 2}} & mcc{textit{Algo 3}} \
cmidrule(lr){2-3} cmidrule(lr){4-5} cmidrule(lr){6-7}%
Dataset & $D_1$ & $D_2$ & $D_1$ & $D_2$ & $D_1$ & $D_2$ \
midrule
Matric 1 & 0 & 0 & 0 & 0 & 0 & 0 \
addlinespace%
Matric 2 & 0 & 0 & 0 & 0 & 0 & 0 \
addlinespace%
Matric 3 & 0 & 0 & 0 & 0 & 0 & 0 \
addlinespace
Matric 4 & 0 & 0 & 0 & 0 & 0 & 0 \
midrule
multicolumn{7}{c}{textbf{XYZ Metrics}} \ midrule[0.3pt]
textbf{Algorithm}
& mcc{textit{Algo 1}} & mcc{textit{Algo 2}} & mcc{textit{Algo 3}} \
cmidrule(lr){2-3} cmidrule(lr){4-5} cmidrule(lr){6-7}%
{Matric 5} & mcc{0} & mcc{0} & mcc{0} \
addlinespace
{Matric 6} & mcc{0} & mcc{0} & mcc{0} \
bottomrule
end{tabularx}
end{table}
end{document}
which gives:
add a comment |
i only repair some inconsistencies in your column width calculation. the sum of the defined widths is 4.78. but it should be an integer number. all other is opinion based ...
my suggestion for your table code (with some opinion based changes and simplification of writing) is:
documentclass{article}
usepackage[margin=1in]{geometry}
usepackage[skip=1ex]{caption}
usepackage{ragged2e}
usepackage{booktabs,tabularx}
newcommandmcc[1]{multicolumn{2}{c}{#1}}
begin{document}
begin{table}[!ht]
caption{Evaluation results}
centering
begin{tabularx}{textwidth}{
>{hsize=0.4hsizebfseriesRaggedRight}X
*{6}{>{hsize=0.1hsizecenteringarraybackslash}X}}
toprule
multicolumn{7}{c}{textbf{ABC Metrics}} \
midrule
textbf{Algorithm}
& mcc{textit{Algo 1}} & mcc{textit{Algo 2}} & mcc{textit{Algo 3}} \
cmidrule(lr){2-3} cmidrule(lr){4-5} cmidrule(lr){6-7}%
Dataset & $D_1$ & $D_2$ & $D_1$ & $D_2$ & $D_1$ & $D_2$ \
midrule
Matric 1 & 0 & 0 & 0 & 0 & 0 & 0 \
addlinespace%
Matric 2 & 0 & 0 & 0 & 0 & 0 & 0 \
addlinespace%
Matric 3 & 0 & 0 & 0 & 0 & 0 & 0 \
addlinespace
Matric 4 & 0 & 0 & 0 & 0 & 0 & 0 \
midrule
multicolumn{7}{c}{textbf{XYZ Metrics}} \ midrule[0.3pt]
textbf{Algorithm}
& mcc{textit{Algo 1}} & mcc{textit{Algo 2}} & mcc{textit{Algo 3}} \
cmidrule(lr){2-3} cmidrule(lr){4-5} cmidrule(lr){6-7}%
{Matric 5} & mcc{0} & mcc{0} & mcc{0} \
addlinespace
{Matric 6} & mcc{0} & mcc{0} & mcc{0} \
bottomrule
end{tabularx}
end{table}
end{document}
which gives:
add a comment |
i only repair some inconsistencies in your column width calculation. the sum of the defined widths is 4.78. but it should be an integer number. all other is opinion based ...
my suggestion for your table code (with some opinion based changes and simplification of writing) is:
documentclass{article}
usepackage[margin=1in]{geometry}
usepackage[skip=1ex]{caption}
usepackage{ragged2e}
usepackage{booktabs,tabularx}
newcommandmcc[1]{multicolumn{2}{c}{#1}}
begin{document}
begin{table}[!ht]
caption{Evaluation results}
centering
begin{tabularx}{textwidth}{
>{hsize=0.4hsizebfseriesRaggedRight}X
*{6}{>{hsize=0.1hsizecenteringarraybackslash}X}}
toprule
multicolumn{7}{c}{textbf{ABC Metrics}} \
midrule
textbf{Algorithm}
& mcc{textit{Algo 1}} & mcc{textit{Algo 2}} & mcc{textit{Algo 3}} \
cmidrule(lr){2-3} cmidrule(lr){4-5} cmidrule(lr){6-7}%
Dataset & $D_1$ & $D_2$ & $D_1$ & $D_2$ & $D_1$ & $D_2$ \
midrule
Matric 1 & 0 & 0 & 0 & 0 & 0 & 0 \
addlinespace%
Matric 2 & 0 & 0 & 0 & 0 & 0 & 0 \
addlinespace%
Matric 3 & 0 & 0 & 0 & 0 & 0 & 0 \
addlinespace
Matric 4 & 0 & 0 & 0 & 0 & 0 & 0 \
midrule
multicolumn{7}{c}{textbf{XYZ Metrics}} \ midrule[0.3pt]
textbf{Algorithm}
& mcc{textit{Algo 1}} & mcc{textit{Algo 2}} & mcc{textit{Algo 3}} \
cmidrule(lr){2-3} cmidrule(lr){4-5} cmidrule(lr){6-7}%
{Matric 5} & mcc{0} & mcc{0} & mcc{0} \
addlinespace
{Matric 6} & mcc{0} & mcc{0} & mcc{0} \
bottomrule
end{tabularx}
end{table}
end{document}
which gives:
i only repair some inconsistencies in your column width calculation. the sum of the defined widths is 4.78. but it should be an integer number. all other is opinion based ...
my suggestion for your table code (with some opinion based changes and simplification of writing) is:
documentclass{article}
usepackage[margin=1in]{geometry}
usepackage[skip=1ex]{caption}
usepackage{ragged2e}
usepackage{booktabs,tabularx}
newcommandmcc[1]{multicolumn{2}{c}{#1}}
begin{document}
begin{table}[!ht]
caption{Evaluation results}
centering
begin{tabularx}{textwidth}{
>{hsize=0.4hsizebfseriesRaggedRight}X
*{6}{>{hsize=0.1hsizecenteringarraybackslash}X}}
toprule
multicolumn{7}{c}{textbf{ABC Metrics}} \
midrule
textbf{Algorithm}
& mcc{textit{Algo 1}} & mcc{textit{Algo 2}} & mcc{textit{Algo 3}} \
cmidrule(lr){2-3} cmidrule(lr){4-5} cmidrule(lr){6-7}%
Dataset & $D_1$ & $D_2$ & $D_1$ & $D_2$ & $D_1$ & $D_2$ \
midrule
Matric 1 & 0 & 0 & 0 & 0 & 0 & 0 \
addlinespace%
Matric 2 & 0 & 0 & 0 & 0 & 0 & 0 \
addlinespace%
Matric 3 & 0 & 0 & 0 & 0 & 0 & 0 \
addlinespace
Matric 4 & 0 & 0 & 0 & 0 & 0 & 0 \
midrule
multicolumn{7}{c}{textbf{XYZ Metrics}} \ midrule[0.3pt]
textbf{Algorithm}
& mcc{textit{Algo 1}} & mcc{textit{Algo 2}} & mcc{textit{Algo 3}} \
cmidrule(lr){2-3} cmidrule(lr){4-5} cmidrule(lr){6-7}%
{Matric 5} & mcc{0} & mcc{0} & mcc{0} \
addlinespace
{Matric 6} & mcc{0} & mcc{0} & mcc{0} \
bottomrule
end{tabularx}
end{table}
end{document}
which gives:
answered Jan 3 at 2:47
ZarkoZarko
122k865160
122k865160
add a comment |
add a comment |
Some general observations and comments:
I don't understand why you're using 1
tabularx
environment for two structures that don't look all that much connected. I'd use two separate environments.Since there appears to be no line-wrapping whatsoever, I don't understand why you'd be using a
tabularx
environment to begin with. Why not use atabular*
environment? For that matter, why not usetabular
environments?
Some more specific comments:
Using bold-facing and/or italics in the header cells is a transparent attempt to compensate for the lack of clear visual structure. With such an approach, you are mostly going to come across as somebody who (a) isn't particularly well organized and (b) thinks it's ok to shout at people. The people I know, though, very much prefer not to be shouted at. Your experience may differ...
Based on the information you've provided, the material can easily be presented in two separate, side-by-side
tabular
environments.
The following solution tries to present the material without any shouting, while still trying to be visually "open" and inviting.
PS. What's a "matric"?
documentclass{article}
usepackage[margin=1in,letterpaper]{geometry}
usepackage[skip=0.5baselineskip]{caption} % optional
usepackage{array,booktabs}
begin{document}
begin{table}[!ht]
setlengthtabcolsep{10pt} % default: 6pt
caption{Evaluation results}
begin{tabular}[t]{@{} l *{6}{c} @{}}
multicolumn{7}{@{}l}{ABC Metrics, for datasets $D_1$ and $D_2$} \
toprule
& multicolumn{6}{c@{}}{Algorithm}\
cmidrule(l){2-7}
& multicolumn{2}{c}{Algo 1}
& multicolumn{2}{c}{Algo 2}
& multicolumn{2}{c@{}}{Algo 3} \
cmidrule(lr){2-3} cmidrule(lr){4-5} cmidrule(l){6-7}
& $D_1$ & $D_2$ & $D_1$ & $D_2$ & $D_1$ & $D_2$ \
midrule
Matric 1 & 0 & 0 & 0 & 0 & 0 & 0 \
Matric 2 & 0 & 0 & 0 & 0 & 0 & 0 \
Matric 3 & 0 & 0 & 0 & 0 & 0 & 0 \
Matric 4 & 0 & 0 & 0 & 0 & 0 & 0 \
bottomrule
end{tabular}
hspace{fill}
begin{tabular}[t]{@{} l ccc @{}}
multicolumn{4}{@{}l}{XYZ Metrics} \
toprule
& multicolumn{3}{c@{}}{Algorithm}\
cmidrule(l){2-4}
& Algo 1 & Algo 2 & Algo 3 \
midrule
Matric 5 & 0 & 0 & 0 \
Matric 6 & 0 & 0 & 0 \
bottomrule
end{tabular}
end{table}
end{document}
add a comment |
Some general observations and comments:
I don't understand why you're using 1
tabularx
environment for two structures that don't look all that much connected. I'd use two separate environments.Since there appears to be no line-wrapping whatsoever, I don't understand why you'd be using a
tabularx
environment to begin with. Why not use atabular*
environment? For that matter, why not usetabular
environments?
Some more specific comments:
Using bold-facing and/or italics in the header cells is a transparent attempt to compensate for the lack of clear visual structure. With such an approach, you are mostly going to come across as somebody who (a) isn't particularly well organized and (b) thinks it's ok to shout at people. The people I know, though, very much prefer not to be shouted at. Your experience may differ...
Based on the information you've provided, the material can easily be presented in two separate, side-by-side
tabular
environments.
The following solution tries to present the material without any shouting, while still trying to be visually "open" and inviting.
PS. What's a "matric"?
documentclass{article}
usepackage[margin=1in,letterpaper]{geometry}
usepackage[skip=0.5baselineskip]{caption} % optional
usepackage{array,booktabs}
begin{document}
begin{table}[!ht]
setlengthtabcolsep{10pt} % default: 6pt
caption{Evaluation results}
begin{tabular}[t]{@{} l *{6}{c} @{}}
multicolumn{7}{@{}l}{ABC Metrics, for datasets $D_1$ and $D_2$} \
toprule
& multicolumn{6}{c@{}}{Algorithm}\
cmidrule(l){2-7}
& multicolumn{2}{c}{Algo 1}
& multicolumn{2}{c}{Algo 2}
& multicolumn{2}{c@{}}{Algo 3} \
cmidrule(lr){2-3} cmidrule(lr){4-5} cmidrule(l){6-7}
& $D_1$ & $D_2$ & $D_1$ & $D_2$ & $D_1$ & $D_2$ \
midrule
Matric 1 & 0 & 0 & 0 & 0 & 0 & 0 \
Matric 2 & 0 & 0 & 0 & 0 & 0 & 0 \
Matric 3 & 0 & 0 & 0 & 0 & 0 & 0 \
Matric 4 & 0 & 0 & 0 & 0 & 0 & 0 \
bottomrule
end{tabular}
hspace{fill}
begin{tabular}[t]{@{} l ccc @{}}
multicolumn{4}{@{}l}{XYZ Metrics} \
toprule
& multicolumn{3}{c@{}}{Algorithm}\
cmidrule(l){2-4}
& Algo 1 & Algo 2 & Algo 3 \
midrule
Matric 5 & 0 & 0 & 0 \
Matric 6 & 0 & 0 & 0 \
bottomrule
end{tabular}
end{table}
end{document}
add a comment |
Some general observations and comments:
I don't understand why you're using 1
tabularx
environment for two structures that don't look all that much connected. I'd use two separate environments.Since there appears to be no line-wrapping whatsoever, I don't understand why you'd be using a
tabularx
environment to begin with. Why not use atabular*
environment? For that matter, why not usetabular
environments?
Some more specific comments:
Using bold-facing and/or italics in the header cells is a transparent attempt to compensate for the lack of clear visual structure. With such an approach, you are mostly going to come across as somebody who (a) isn't particularly well organized and (b) thinks it's ok to shout at people. The people I know, though, very much prefer not to be shouted at. Your experience may differ...
Based on the information you've provided, the material can easily be presented in two separate, side-by-side
tabular
environments.
The following solution tries to present the material without any shouting, while still trying to be visually "open" and inviting.
PS. What's a "matric"?
documentclass{article}
usepackage[margin=1in,letterpaper]{geometry}
usepackage[skip=0.5baselineskip]{caption} % optional
usepackage{array,booktabs}
begin{document}
begin{table}[!ht]
setlengthtabcolsep{10pt} % default: 6pt
caption{Evaluation results}
begin{tabular}[t]{@{} l *{6}{c} @{}}
multicolumn{7}{@{}l}{ABC Metrics, for datasets $D_1$ and $D_2$} \
toprule
& multicolumn{6}{c@{}}{Algorithm}\
cmidrule(l){2-7}
& multicolumn{2}{c}{Algo 1}
& multicolumn{2}{c}{Algo 2}
& multicolumn{2}{c@{}}{Algo 3} \
cmidrule(lr){2-3} cmidrule(lr){4-5} cmidrule(l){6-7}
& $D_1$ & $D_2$ & $D_1$ & $D_2$ & $D_1$ & $D_2$ \
midrule
Matric 1 & 0 & 0 & 0 & 0 & 0 & 0 \
Matric 2 & 0 & 0 & 0 & 0 & 0 & 0 \
Matric 3 & 0 & 0 & 0 & 0 & 0 & 0 \
Matric 4 & 0 & 0 & 0 & 0 & 0 & 0 \
bottomrule
end{tabular}
hspace{fill}
begin{tabular}[t]{@{} l ccc @{}}
multicolumn{4}{@{}l}{XYZ Metrics} \
toprule
& multicolumn{3}{c@{}}{Algorithm}\
cmidrule(l){2-4}
& Algo 1 & Algo 2 & Algo 3 \
midrule
Matric 5 & 0 & 0 & 0 \
Matric 6 & 0 & 0 & 0 \
bottomrule
end{tabular}
end{table}
end{document}
Some general observations and comments:
I don't understand why you're using 1
tabularx
environment for two structures that don't look all that much connected. I'd use two separate environments.Since there appears to be no line-wrapping whatsoever, I don't understand why you'd be using a
tabularx
environment to begin with. Why not use atabular*
environment? For that matter, why not usetabular
environments?
Some more specific comments:
Using bold-facing and/or italics in the header cells is a transparent attempt to compensate for the lack of clear visual structure. With such an approach, you are mostly going to come across as somebody who (a) isn't particularly well organized and (b) thinks it's ok to shout at people. The people I know, though, very much prefer not to be shouted at. Your experience may differ...
Based on the information you've provided, the material can easily be presented in two separate, side-by-side
tabular
environments.
The following solution tries to present the material without any shouting, while still trying to be visually "open" and inviting.
PS. What's a "matric"?
documentclass{article}
usepackage[margin=1in,letterpaper]{geometry}
usepackage[skip=0.5baselineskip]{caption} % optional
usepackage{array,booktabs}
begin{document}
begin{table}[!ht]
setlengthtabcolsep{10pt} % default: 6pt
caption{Evaluation results}
begin{tabular}[t]{@{} l *{6}{c} @{}}
multicolumn{7}{@{}l}{ABC Metrics, for datasets $D_1$ and $D_2$} \
toprule
& multicolumn{6}{c@{}}{Algorithm}\
cmidrule(l){2-7}
& multicolumn{2}{c}{Algo 1}
& multicolumn{2}{c}{Algo 2}
& multicolumn{2}{c@{}}{Algo 3} \
cmidrule(lr){2-3} cmidrule(lr){4-5} cmidrule(l){6-7}
& $D_1$ & $D_2$ & $D_1$ & $D_2$ & $D_1$ & $D_2$ \
midrule
Matric 1 & 0 & 0 & 0 & 0 & 0 & 0 \
Matric 2 & 0 & 0 & 0 & 0 & 0 & 0 \
Matric 3 & 0 & 0 & 0 & 0 & 0 & 0 \
Matric 4 & 0 & 0 & 0 & 0 & 0 & 0 \
bottomrule
end{tabular}
hspace{fill}
begin{tabular}[t]{@{} l ccc @{}}
multicolumn{4}{@{}l}{XYZ Metrics} \
toprule
& multicolumn{3}{c@{}}{Algorithm}\
cmidrule(l){2-4}
& Algo 1 & Algo 2 & Algo 3 \
midrule
Matric 5 & 0 & 0 & 0 \
Matric 6 & 0 & 0 & 0 \
bottomrule
end{tabular}
end{table}
end{document}
answered Jan 3 at 4:00
MicoMico
275k30372760
275k30372760
add a comment |
add a comment |
I propose this variant layout, with correct coefficients fòr hsize=
:
documentclass{article}
usepackage[margin=1in]{geometry}
usepackage[skip=1ex]{caption}
usepackage[table, svgnames]{xcolor}
usepackage{ragged2e}
usepackage{booktabs,tabularx}
newcommandmcc[1]{multicolumn{2}{c}{#1}}
begin{document}
begin{table}[!ht]
caption{Evaluation results}
centering
setlength{extrarowheight}{2pt}
setlength{belowrulesep}{0pt}
begin{tabularx}{textwidth}{
>{hsize=2.8hsizebfseriesRaggedRight}X
*{6}{>{hsize=0.7hsizecenteringarraybackslash}X}}
toprule
& multicolumn{6}{c}{textbf{Algorithm}} \
cmidrule{2-7}
& mcc{textit{Algo 1}} & mcc{textit{Algo 2}} & mcc{textit{Algo 3}} \
rowcolor{WhiteSmoke} ABC Metricshfill Dataset & $D₁$ & $D₂$ & $D₁$ & $D₂$ & $D₁$ & $D₂$ \
addlinespace
Metric 1 & 0 & 0 & 0 & 0 & 0 & 0 \
addlinespace%
Metric 2 & 0 & 0 & 0 & 0 & 0 & 0 \
addlinespace%
Metric 3 & 0 & 0 & 0 & 0 & 0 & 0 \
addlinespace
Metric 4 & 0 & 0 & 0 & 0 & 0 & 0 \
addlinespace
rowcolor{WhiteSmoke} XYZ Metrics & & & & & & \
addlinespace
{Metric 5} & mcc{0} & mcc{0} & mcc{0} \
addlinespace
{Metric 6} & mcc{0} & mcc{0} & mcc{0} \
bottomrule
end{tabularx}
end{table}
end{document}
add a comment |
I propose this variant layout, with correct coefficients fòr hsize=
:
documentclass{article}
usepackage[margin=1in]{geometry}
usepackage[skip=1ex]{caption}
usepackage[table, svgnames]{xcolor}
usepackage{ragged2e}
usepackage{booktabs,tabularx}
newcommandmcc[1]{multicolumn{2}{c}{#1}}
begin{document}
begin{table}[!ht]
caption{Evaluation results}
centering
setlength{extrarowheight}{2pt}
setlength{belowrulesep}{0pt}
begin{tabularx}{textwidth}{
>{hsize=2.8hsizebfseriesRaggedRight}X
*{6}{>{hsize=0.7hsizecenteringarraybackslash}X}}
toprule
& multicolumn{6}{c}{textbf{Algorithm}} \
cmidrule{2-7}
& mcc{textit{Algo 1}} & mcc{textit{Algo 2}} & mcc{textit{Algo 3}} \
rowcolor{WhiteSmoke} ABC Metricshfill Dataset & $D₁$ & $D₂$ & $D₁$ & $D₂$ & $D₁$ & $D₂$ \
addlinespace
Metric 1 & 0 & 0 & 0 & 0 & 0 & 0 \
addlinespace%
Metric 2 & 0 & 0 & 0 & 0 & 0 & 0 \
addlinespace%
Metric 3 & 0 & 0 & 0 & 0 & 0 & 0 \
addlinespace
Metric 4 & 0 & 0 & 0 & 0 & 0 & 0 \
addlinespace
rowcolor{WhiteSmoke} XYZ Metrics & & & & & & \
addlinespace
{Metric 5} & mcc{0} & mcc{0} & mcc{0} \
addlinespace
{Metric 6} & mcc{0} & mcc{0} & mcc{0} \
bottomrule
end{tabularx}
end{table}
end{document}
add a comment |
I propose this variant layout, with correct coefficients fòr hsize=
:
documentclass{article}
usepackage[margin=1in]{geometry}
usepackage[skip=1ex]{caption}
usepackage[table, svgnames]{xcolor}
usepackage{ragged2e}
usepackage{booktabs,tabularx}
newcommandmcc[1]{multicolumn{2}{c}{#1}}
begin{document}
begin{table}[!ht]
caption{Evaluation results}
centering
setlength{extrarowheight}{2pt}
setlength{belowrulesep}{0pt}
begin{tabularx}{textwidth}{
>{hsize=2.8hsizebfseriesRaggedRight}X
*{6}{>{hsize=0.7hsizecenteringarraybackslash}X}}
toprule
& multicolumn{6}{c}{textbf{Algorithm}} \
cmidrule{2-7}
& mcc{textit{Algo 1}} & mcc{textit{Algo 2}} & mcc{textit{Algo 3}} \
rowcolor{WhiteSmoke} ABC Metricshfill Dataset & $D₁$ & $D₂$ & $D₁$ & $D₂$ & $D₁$ & $D₂$ \
addlinespace
Metric 1 & 0 & 0 & 0 & 0 & 0 & 0 \
addlinespace%
Metric 2 & 0 & 0 & 0 & 0 & 0 & 0 \
addlinespace%
Metric 3 & 0 & 0 & 0 & 0 & 0 & 0 \
addlinespace
Metric 4 & 0 & 0 & 0 & 0 & 0 & 0 \
addlinespace
rowcolor{WhiteSmoke} XYZ Metrics & & & & & & \
addlinespace
{Metric 5} & mcc{0} & mcc{0} & mcc{0} \
addlinespace
{Metric 6} & mcc{0} & mcc{0} & mcc{0} \
bottomrule
end{tabularx}
end{table}
end{document}
I propose this variant layout, with correct coefficients fòr hsize=
:
documentclass{article}
usepackage[margin=1in]{geometry}
usepackage[skip=1ex]{caption}
usepackage[table, svgnames]{xcolor}
usepackage{ragged2e}
usepackage{booktabs,tabularx}
newcommandmcc[1]{multicolumn{2}{c}{#1}}
begin{document}
begin{table}[!ht]
caption{Evaluation results}
centering
setlength{extrarowheight}{2pt}
setlength{belowrulesep}{0pt}
begin{tabularx}{textwidth}{
>{hsize=2.8hsizebfseriesRaggedRight}X
*{6}{>{hsize=0.7hsizecenteringarraybackslash}X}}
toprule
& multicolumn{6}{c}{textbf{Algorithm}} \
cmidrule{2-7}
& mcc{textit{Algo 1}} & mcc{textit{Algo 2}} & mcc{textit{Algo 3}} \
rowcolor{WhiteSmoke} ABC Metricshfill Dataset & $D₁$ & $D₂$ & $D₁$ & $D₂$ & $D₁$ & $D₂$ \
addlinespace
Metric 1 & 0 & 0 & 0 & 0 & 0 & 0 \
addlinespace%
Metric 2 & 0 & 0 & 0 & 0 & 0 & 0 \
addlinespace%
Metric 3 & 0 & 0 & 0 & 0 & 0 & 0 \
addlinespace
Metric 4 & 0 & 0 & 0 & 0 & 0 & 0 \
addlinespace
rowcolor{WhiteSmoke} XYZ Metrics & & & & & & \
addlinespace
{Metric 5} & mcc{0} & mcc{0} & mcc{0} \
addlinespace
{Metric 6} & mcc{0} & mcc{0} & mcc{0} \
bottomrule
end{tabularx}
end{table}
end{document}
answered Jan 4 at 0:46
BernardBernard
167k769194
167k769194
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%2f468355%2fhow-to-improve-this-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
2
I think this is off-topic because it is subjective. You should ask how to make changes to a table, not opinions on what improvements can you do.
– manooooh
Jan 3 at 2:24
4
@manooooh That's actually a good question for Meta, whether code review questions are accepted here.
– Henri Menke
Jan 3 at 4:42
@HenriMenke: See Tagging "Please improve my code" posts and To what extent are code-review-style questions welcome?
– Werner
Jan 3 at 5:55