Continuous vertical line using booktabs in tabularx table?Which tabular packages do which tasks and which...
Why does Intel's Haswell chip allow FP multiplication to be twice as fast as addition?
How can I solve for the intersection points of two ellipses?
Three legged NOT gate? What is this symbol?
What costs less energy? Roll or Yaw?
Multirow in tabularx?
Y2K... in 2019?
The equation of motion for a scalar field in curved spacetime in terms of the covariant derivative
How to avoid the "need" to learn more before conducting research?
what is measured in units of sat/kw?
Trying to write a shell script that keeps testing a server remotely, but it keeps falling in else statement when I logout
During the Space Shuttle Columbia Disaster of 2003, Why Did The Flight Director Say, "Lock the doors."?
Help evaluating integral (anything simple that I am missing?)
Is refreshing multiple times a test case for web applications?
Blocking people from taking pictures of me with smartphone
Write an interpreter for *
Should I ask for permission to write an expository post about someone's else research?
Does a code snippet compile? Or does it get compiled?
In a 2 layer PCB with a top layer densely populated, from an EMI & EMC point of view should the ground plane be on top, bottom or both and why?
Double redundancy for the Saturn V LVDC computer memory, how were disagreements resolved?
What is the length of pair of wires after twisting them around each other?
Why did the RAAF procure the F/A-18 despite being purpose-built for carriers?
(11 of 11: Meta) What is Pyramid Cult's All-Time Favorite?
Who are these characters/superheroes in the posters from Chris's room in Family Guy?
In SQL Server, why does backward scan of clustered index cannot use parallelism?
Continuous vertical line using booktabs in tabularx table?
Which tabular packages do which tasks and which packages conflict?Vertical table lines are discontinuous with booktabsVertical alignment using multirow and booktabsVertical table lines are discontinuous with booktabsTable without using booktabsvertical alignment using tabularx / arraystretchFormatting table using booktabsBooktabs table with multirows: alternative to vertical rules?Vertical line not shown in a booktabs style table.Discontinuous vertical dash lines in tabularx, booktabs environmentBroken vertical line in tabularxTable with vertical aligned header text [tabularx]
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}
How can we draw a continuous vertical line using booktabs in table?
What is the simplest method to maximise the width of a table?
There are lots of methods, very confusing.
documentclass{article}
usepackage{makecell} % for bold in table using small
renewcommandtheadfont{small} % for bold in table using small
usepackage{tabularx, ragged2e}
usepackage{booktabs}
begin{document}
begin{table}[!ht]
centering
begin{tabularx}{textwidth}{l>{raggedrightarraybackslash}ccc|ccc}
toprule
& multicolumn{3}{c|}{textbf{Paired Differences1}} & multicolumn{3}{c}{textbf{Paired Differences2}}\
cmidrule{2-7}
& small {textbf{Statistic}}
& thead{small {textbf{df}}}
& thead{small {textbf{Sig.}}}
& small {textbf{Statistic}}
& thead{small {textbf{df}}}
& thead{small {textbf{Sig.}}} \
midrule
Difference & 44.20 & 14.36 & 4.54 & .957 & 10 & .746\
bottomrule
end{tabularx}
caption{Testing Testing Testing%
label{tab:test1234}%
}
end{table}
end{document}
tables vertical-alignment tabularx booktabs
|
show 6 more comments
How can we draw a continuous vertical line using booktabs in table?
What is the simplest method to maximise the width of a table?
There are lots of methods, very confusing.
documentclass{article}
usepackage{makecell} % for bold in table using small
renewcommandtheadfont{small} % for bold in table using small
usepackage{tabularx, ragged2e}
usepackage{booktabs}
begin{document}
begin{table}[!ht]
centering
begin{tabularx}{textwidth}{l>{raggedrightarraybackslash}ccc|ccc}
toprule
& multicolumn{3}{c|}{textbf{Paired Differences1}} & multicolumn{3}{c}{textbf{Paired Differences2}}\
cmidrule{2-7}
& small {textbf{Statistic}}
& thead{small {textbf{df}}}
& thead{small {textbf{Sig.}}}
& small {textbf{Statistic}}
& thead{small {textbf{df}}}
& thead{small {textbf{Sig.}}} \
midrule
Difference & 44.20 & 14.36 & 4.54 & .957 & 10 & .746\
bottomrule
end{tabularx}
caption{Testing Testing Testing%
label{tab:test1234}%
}
end{table}
end{document}
tables vertical-alignment tabularx booktabs
1
A tabularx environment requires at least oneX
column to make sense. This answers you second question. As to the first,booktabs
is not adapted to vertical rules. For which reason do you ue it?
– Bernard
8 hours ago
3
To quote from thebooktabs
manual: "You will not go far wrong if you remember two simple guidelines at all times: 1. Never, ever use vertical rules. [...]" Therefore, I'd recommend to either stick to this rule, or, if you prefer vertical lines, usehline
instead of tehbooktabs
horizontal lines.
– leandriis
8 hours ago
Please also note, that oyu can removesmall
from athead
commands, as you already usedrenewcommandtheadfont{small}´ to automatically make all text in
thead` commands small. You can go even further and remove all thetextbf
inside ofthead
commands, if you userenewcommandtheadfont{smallbfseries}
– leandriis
8 hours ago
Regarding "the simplest method to maximise the width of a table" where would you like the extra white space to be? Between column 1 and 2, or 4 and 5 or equally distributed between all columns? Are there entries in the first column that are wider than the shown one? Why would wou even want your table to be wieder than it currently is?
– leandriis
8 hours ago
1
Regarding the vertical lines, you might also want to have a loom at Vertical table lines are discontinuous with booktabs
– leandriis
8 hours ago
|
show 6 more comments
How can we draw a continuous vertical line using booktabs in table?
What is the simplest method to maximise the width of a table?
There are lots of methods, very confusing.
documentclass{article}
usepackage{makecell} % for bold in table using small
renewcommandtheadfont{small} % for bold in table using small
usepackage{tabularx, ragged2e}
usepackage{booktabs}
begin{document}
begin{table}[!ht]
centering
begin{tabularx}{textwidth}{l>{raggedrightarraybackslash}ccc|ccc}
toprule
& multicolumn{3}{c|}{textbf{Paired Differences1}} & multicolumn{3}{c}{textbf{Paired Differences2}}\
cmidrule{2-7}
& small {textbf{Statistic}}
& thead{small {textbf{df}}}
& thead{small {textbf{Sig.}}}
& small {textbf{Statistic}}
& thead{small {textbf{df}}}
& thead{small {textbf{Sig.}}} \
midrule
Difference & 44.20 & 14.36 & 4.54 & .957 & 10 & .746\
bottomrule
end{tabularx}
caption{Testing Testing Testing%
label{tab:test1234}%
}
end{table}
end{document}
tables vertical-alignment tabularx booktabs
How can we draw a continuous vertical line using booktabs in table?
What is the simplest method to maximise the width of a table?
There are lots of methods, very confusing.
documentclass{article}
usepackage{makecell} % for bold in table using small
renewcommandtheadfont{small} % for bold in table using small
usepackage{tabularx, ragged2e}
usepackage{booktabs}
begin{document}
begin{table}[!ht]
centering
begin{tabularx}{textwidth}{l>{raggedrightarraybackslash}ccc|ccc}
toprule
& multicolumn{3}{c|}{textbf{Paired Differences1}} & multicolumn{3}{c}{textbf{Paired Differences2}}\
cmidrule{2-7}
& small {textbf{Statistic}}
& thead{small {textbf{df}}}
& thead{small {textbf{Sig.}}}
& small {textbf{Statistic}}
& thead{small {textbf{df}}}
& thead{small {textbf{Sig.}}} \
midrule
Difference & 44.20 & 14.36 & 4.54 & .957 & 10 & .746\
bottomrule
end{tabularx}
caption{Testing Testing Testing%
label{tab:test1234}%
}
end{table}
end{document}
tables vertical-alignment tabularx booktabs
tables vertical-alignment tabularx booktabs
edited 8 hours ago
leandriis
17.8k1 gold badge11 silver badges37 bronze badges
17.8k1 gold badge11 silver badges37 bronze badges
asked 8 hours ago
aanaan
1566 bronze badges
1566 bronze badges
1
A tabularx environment requires at least oneX
column to make sense. This answers you second question. As to the first,booktabs
is not adapted to vertical rules. For which reason do you ue it?
– Bernard
8 hours ago
3
To quote from thebooktabs
manual: "You will not go far wrong if you remember two simple guidelines at all times: 1. Never, ever use vertical rules. [...]" Therefore, I'd recommend to either stick to this rule, or, if you prefer vertical lines, usehline
instead of tehbooktabs
horizontal lines.
– leandriis
8 hours ago
Please also note, that oyu can removesmall
from athead
commands, as you already usedrenewcommandtheadfont{small}´ to automatically make all text in
thead` commands small. You can go even further and remove all thetextbf
inside ofthead
commands, if you userenewcommandtheadfont{smallbfseries}
– leandriis
8 hours ago
Regarding "the simplest method to maximise the width of a table" where would you like the extra white space to be? Between column 1 and 2, or 4 and 5 or equally distributed between all columns? Are there entries in the first column that are wider than the shown one? Why would wou even want your table to be wieder than it currently is?
– leandriis
8 hours ago
1
Regarding the vertical lines, you might also want to have a loom at Vertical table lines are discontinuous with booktabs
– leandriis
8 hours ago
|
show 6 more comments
1
A tabularx environment requires at least oneX
column to make sense. This answers you second question. As to the first,booktabs
is not adapted to vertical rules. For which reason do you ue it?
– Bernard
8 hours ago
3
To quote from thebooktabs
manual: "You will not go far wrong if you remember two simple guidelines at all times: 1. Never, ever use vertical rules. [...]" Therefore, I'd recommend to either stick to this rule, or, if you prefer vertical lines, usehline
instead of tehbooktabs
horizontal lines.
– leandriis
8 hours ago
Please also note, that oyu can removesmall
from athead
commands, as you already usedrenewcommandtheadfont{small}´ to automatically make all text in
thead` commands small. You can go even further and remove all thetextbf
inside ofthead
commands, if you userenewcommandtheadfont{smallbfseries}
– leandriis
8 hours ago
Regarding "the simplest method to maximise the width of a table" where would you like the extra white space to be? Between column 1 and 2, or 4 and 5 or equally distributed between all columns? Are there entries in the first column that are wider than the shown one? Why would wou even want your table to be wieder than it currently is?
– leandriis
8 hours ago
1
Regarding the vertical lines, you might also want to have a loom at Vertical table lines are discontinuous with booktabs
– leandriis
8 hours ago
1
1
A tabularx environment requires at least one
X
column to make sense. This answers you second question. As to the first, booktabs
is not adapted to vertical rules. For which reason do you ue it?– Bernard
8 hours ago
A tabularx environment requires at least one
X
column to make sense. This answers you second question. As to the first, booktabs
is not adapted to vertical rules. For which reason do you ue it?– Bernard
8 hours ago
3
3
To quote from the
booktabs
manual: "You will not go far wrong if you remember two simple guidelines at all times: 1. Never, ever use vertical rules. [...]" Therefore, I'd recommend to either stick to this rule, or, if you prefer vertical lines, use hline
instead of teh booktabs
horizontal lines.– leandriis
8 hours ago
To quote from the
booktabs
manual: "You will not go far wrong if you remember two simple guidelines at all times: 1. Never, ever use vertical rules. [...]" Therefore, I'd recommend to either stick to this rule, or, if you prefer vertical lines, use hline
instead of teh booktabs
horizontal lines.– leandriis
8 hours ago
Please also note, that oyu can remove
small
from a thead
commands, as you already used renewcommandtheadfont{small}´ to automatically make all text in
thead` commands small. You can go even further and remove all the textbf
inside of thead
commands, if you use renewcommandtheadfont{smallbfseries}
– leandriis
8 hours ago
Please also note, that oyu can remove
small
from a thead
commands, as you already used renewcommandtheadfont{small}´ to automatically make all text in
thead` commands small. You can go even further and remove all the textbf
inside of thead
commands, if you use renewcommandtheadfont{smallbfseries}
– leandriis
8 hours ago
Regarding "the simplest method to maximise the width of a table" where would you like the extra white space to be? Between column 1 and 2, or 4 and 5 or equally distributed between all columns? Are there entries in the first column that are wider than the shown one? Why would wou even want your table to be wieder than it currently is?
– leandriis
8 hours ago
Regarding "the simplest method to maximise the width of a table" where would you like the extra white space to be? Between column 1 and 2, or 4 and 5 or equally distributed between all columns? Are there entries in the first column that are wider than the shown one? Why would wou even want your table to be wieder than it currently is?
– leandriis
8 hours ago
1
1
Regarding the vertical lines, you might also want to have a loom at Vertical table lines are discontinuous with booktabs
– leandriis
8 hours ago
Regarding the vertical lines, you might also want to have a loom at Vertical table lines are discontinuous with booktabs
– leandriis
8 hours ago
|
show 6 more comments
3 Answers
3
active
oldest
votes
Here is my suggestion. I have used tabular*
in combination with @{extracolsep{fill}}
to make the table as wide as the textwidth and to evenly distribute the excess white space between the columns. I have also removed the vertical line and replaced the single cmidrule
by two adjacent ones with a small white space inbetween. In order to clean up the code, I have also removed the repeated occurences ot small
and textbf
and instead added bfseries
to thedfont
:
documentclass{article}
usepackage{makecell} % for bold in table using small
renewcommandtheadfont{smallbfseries} % for bold in table using small
usepackage{tabularx, ragged2e}
usepackage{booktabs}
begin{document}
begin{table}[!ht]
begin{tabular*}{textwidth}{@{extracolsep{fill}}lcccccc}
toprule
& multicolumn{3}{c}{textbf{Paired Differences1}} & multicolumn{3}{c}{textbf{Paired Differences2}}\
cmidrule(r){2-4} cmidrule(l){5-7}
& thead{Statistic}
& thead{df}
& thead{Sig.}
& thead{Statistic}
& thead{df}
& thead{Sig.} \
midrule
Difference & 44.20 & 14.36 & 4.54 & .957 & 10 & .746\
bottomrule
end{tabular*}
caption{Testing Testing Testing%
label{tab:test1234}%
}
end{table}
end{document}
add a comment |
I would rather replace the vertical line with a supplementary empty column to have a clear separation between the two group of columns. Another possibility, aesthetically, might be to delete the vertical padding of horizontal rules, and replace it with the makegapedcells
command from makecell
, which adds a vertical space at the top and bottom of all cells. As a demonstration, I replaced the vertical line with thick, light grey vrule, which I find more pleasing to the eye than the default thin, black, vertical rule.
documentclass{article}
usepackage{makecell} % for bold in table using small
renewcommandtheadfont{smallbfseries} % for bold in table using small
usepackage{tabularx, ragged2e}
usepackage{booktabs}
usepackage[table, svgnames]{xcolor}
begin{document}
begin{table}[!ht]
centering
begin{tabularx}{textwidth}{X>{raggedrightarraybackslash}ccccccc}
toprule
& multicolumn{3}{c}{textbf{Paired Differences1}} & & multicolumn{3}{c}{textbf{Paired Differences2}}\
cmidrule(lr){2-4} cmidrule(lr){6-8}
& thead{Statistic}
& thead{df }
& thead{ Sig. }
& & thead{Statistic}
& thead{df}
& thead{Sig.} \
midrule
Difference & 44.20 & 14.36 & 4.54 & & .957 & 10 & .746\
bottomrule
end{tabularx}
caption{Testing Testing Testing%
label{tab:test1234}%
}
end{table}
begin{table}[!ht]
centering
setlength{aboverulesep}{0pt}
setlength{belowrulesep}{0pt}
setcellgapes{3pt}makegapedcells
begin{tabularx}{textwidth}{X>{raggedrightarraybackslash}ccc!{color{Gainsboro!50!Lavender}vline width 0.75em}ccc}
toprule
& multicolumn{3}{c!{color{Gainsboro!50!Lavender}vline width 0.75em}}{textbf{Paired Differences1}} & multicolumn{3}{c}{textbf{Paired Differences2}}\noalign{vskip -0.033em}
cmidrule(lr{1.33em}){2-4} cmidrule(lr){5-7}
& thead{Statistic}
& thead{df}
& thead{Sig.}
& thead{Statistic}
& thead{df}
& thead{Sig.} \
noalign{vskip-0.05em}
cmidrule[0.05em](r{0.9em}){1-4}cmidrule[0.05em](l{0.15em}){5-7}
Difference & 44.20 & 14.36 & 4.54 & .957 & 10 & .746\
bottomrule
end{tabularx}
caption{Testing Testing Testing%
label{tab:test1234}%
}
end{table}
end{document}
add a comment |
With combination of S
and X
columns type, without vertical lines, with rounded numbers ... :
documentclass{article}
usepackage{booktabs, tabularx}
usepackage{xparse}
NewExpandableDocumentCommandmcx{O{1}m}
{multicolumn{#1}{>{Centeringsmallbfserieshsize=#1hsize}X}{#2}}
usepackage{ragged2e}
usepackage{siunitx}
begin{document}
begin{table}[ht]
centering
setlengthtabcolsep{0pt}
sisetup{round-integer-to-decimal,
round-mode=places,
table-format=2.2}
begin{tabularx}{linewidth}{l *{6}{S} }
toprule
& mcx[3]{Paired Differences 1}
& mcx[3]{Paired Differences 2} \
cmidrule(r){2-4}cmidrule(l){5-7}
& mcx{Statistic} & mcx{df} & mcx{Sig.}
& mcx{Statistic} & mcx{df} & mcx{Sig.} \
midrule
Difference
& 44.20 & 14.36 & 4.54 & 0.957 & 10 & 0.746 \
bottomrule
end{tabularx}
caption{Testing Testing Testing}
label{tab:test1234}
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%2f503806%2fcontinuous-vertical-line-using-booktabs-in-tabularx-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
Here is my suggestion. I have used tabular*
in combination with @{extracolsep{fill}}
to make the table as wide as the textwidth and to evenly distribute the excess white space between the columns. I have also removed the vertical line and replaced the single cmidrule
by two adjacent ones with a small white space inbetween. In order to clean up the code, I have also removed the repeated occurences ot small
and textbf
and instead added bfseries
to thedfont
:
documentclass{article}
usepackage{makecell} % for bold in table using small
renewcommandtheadfont{smallbfseries} % for bold in table using small
usepackage{tabularx, ragged2e}
usepackage{booktabs}
begin{document}
begin{table}[!ht]
begin{tabular*}{textwidth}{@{extracolsep{fill}}lcccccc}
toprule
& multicolumn{3}{c}{textbf{Paired Differences1}} & multicolumn{3}{c}{textbf{Paired Differences2}}\
cmidrule(r){2-4} cmidrule(l){5-7}
& thead{Statistic}
& thead{df}
& thead{Sig.}
& thead{Statistic}
& thead{df}
& thead{Sig.} \
midrule
Difference & 44.20 & 14.36 & 4.54 & .957 & 10 & .746\
bottomrule
end{tabular*}
caption{Testing Testing Testing%
label{tab:test1234}%
}
end{table}
end{document}
add a comment |
Here is my suggestion. I have used tabular*
in combination with @{extracolsep{fill}}
to make the table as wide as the textwidth and to evenly distribute the excess white space between the columns. I have also removed the vertical line and replaced the single cmidrule
by two adjacent ones with a small white space inbetween. In order to clean up the code, I have also removed the repeated occurences ot small
and textbf
and instead added bfseries
to thedfont
:
documentclass{article}
usepackage{makecell} % for bold in table using small
renewcommandtheadfont{smallbfseries} % for bold in table using small
usepackage{tabularx, ragged2e}
usepackage{booktabs}
begin{document}
begin{table}[!ht]
begin{tabular*}{textwidth}{@{extracolsep{fill}}lcccccc}
toprule
& multicolumn{3}{c}{textbf{Paired Differences1}} & multicolumn{3}{c}{textbf{Paired Differences2}}\
cmidrule(r){2-4} cmidrule(l){5-7}
& thead{Statistic}
& thead{df}
& thead{Sig.}
& thead{Statistic}
& thead{df}
& thead{Sig.} \
midrule
Difference & 44.20 & 14.36 & 4.54 & .957 & 10 & .746\
bottomrule
end{tabular*}
caption{Testing Testing Testing%
label{tab:test1234}%
}
end{table}
end{document}
add a comment |
Here is my suggestion. I have used tabular*
in combination with @{extracolsep{fill}}
to make the table as wide as the textwidth and to evenly distribute the excess white space between the columns. I have also removed the vertical line and replaced the single cmidrule
by two adjacent ones with a small white space inbetween. In order to clean up the code, I have also removed the repeated occurences ot small
and textbf
and instead added bfseries
to thedfont
:
documentclass{article}
usepackage{makecell} % for bold in table using small
renewcommandtheadfont{smallbfseries} % for bold in table using small
usepackage{tabularx, ragged2e}
usepackage{booktabs}
begin{document}
begin{table}[!ht]
begin{tabular*}{textwidth}{@{extracolsep{fill}}lcccccc}
toprule
& multicolumn{3}{c}{textbf{Paired Differences1}} & multicolumn{3}{c}{textbf{Paired Differences2}}\
cmidrule(r){2-4} cmidrule(l){5-7}
& thead{Statistic}
& thead{df}
& thead{Sig.}
& thead{Statistic}
& thead{df}
& thead{Sig.} \
midrule
Difference & 44.20 & 14.36 & 4.54 & .957 & 10 & .746\
bottomrule
end{tabular*}
caption{Testing Testing Testing%
label{tab:test1234}%
}
end{table}
end{document}
Here is my suggestion. I have used tabular*
in combination with @{extracolsep{fill}}
to make the table as wide as the textwidth and to evenly distribute the excess white space between the columns. I have also removed the vertical line and replaced the single cmidrule
by two adjacent ones with a small white space inbetween. In order to clean up the code, I have also removed the repeated occurences ot small
and textbf
and instead added bfseries
to thedfont
:
documentclass{article}
usepackage{makecell} % for bold in table using small
renewcommandtheadfont{smallbfseries} % for bold in table using small
usepackage{tabularx, ragged2e}
usepackage{booktabs}
begin{document}
begin{table}[!ht]
begin{tabular*}{textwidth}{@{extracolsep{fill}}lcccccc}
toprule
& multicolumn{3}{c}{textbf{Paired Differences1}} & multicolumn{3}{c}{textbf{Paired Differences2}}\
cmidrule(r){2-4} cmidrule(l){5-7}
& thead{Statistic}
& thead{df}
& thead{Sig.}
& thead{Statistic}
& thead{df}
& thead{Sig.} \
midrule
Difference & 44.20 & 14.36 & 4.54 & .957 & 10 & .746\
bottomrule
end{tabular*}
caption{Testing Testing Testing%
label{tab:test1234}%
}
end{table}
end{document}
answered 7 hours ago
leandriisleandriis
17.8k1 gold badge11 silver badges37 bronze badges
17.8k1 gold badge11 silver badges37 bronze badges
add a comment |
add a comment |
I would rather replace the vertical line with a supplementary empty column to have a clear separation between the two group of columns. Another possibility, aesthetically, might be to delete the vertical padding of horizontal rules, and replace it with the makegapedcells
command from makecell
, which adds a vertical space at the top and bottom of all cells. As a demonstration, I replaced the vertical line with thick, light grey vrule, which I find more pleasing to the eye than the default thin, black, vertical rule.
documentclass{article}
usepackage{makecell} % for bold in table using small
renewcommandtheadfont{smallbfseries} % for bold in table using small
usepackage{tabularx, ragged2e}
usepackage{booktabs}
usepackage[table, svgnames]{xcolor}
begin{document}
begin{table}[!ht]
centering
begin{tabularx}{textwidth}{X>{raggedrightarraybackslash}ccccccc}
toprule
& multicolumn{3}{c}{textbf{Paired Differences1}} & & multicolumn{3}{c}{textbf{Paired Differences2}}\
cmidrule(lr){2-4} cmidrule(lr){6-8}
& thead{Statistic}
& thead{df }
& thead{ Sig. }
& & thead{Statistic}
& thead{df}
& thead{Sig.} \
midrule
Difference & 44.20 & 14.36 & 4.54 & & .957 & 10 & .746\
bottomrule
end{tabularx}
caption{Testing Testing Testing%
label{tab:test1234}%
}
end{table}
begin{table}[!ht]
centering
setlength{aboverulesep}{0pt}
setlength{belowrulesep}{0pt}
setcellgapes{3pt}makegapedcells
begin{tabularx}{textwidth}{X>{raggedrightarraybackslash}ccc!{color{Gainsboro!50!Lavender}vline width 0.75em}ccc}
toprule
& multicolumn{3}{c!{color{Gainsboro!50!Lavender}vline width 0.75em}}{textbf{Paired Differences1}} & multicolumn{3}{c}{textbf{Paired Differences2}}\noalign{vskip -0.033em}
cmidrule(lr{1.33em}){2-4} cmidrule(lr){5-7}
& thead{Statistic}
& thead{df}
& thead{Sig.}
& thead{Statistic}
& thead{df}
& thead{Sig.} \
noalign{vskip-0.05em}
cmidrule[0.05em](r{0.9em}){1-4}cmidrule[0.05em](l{0.15em}){5-7}
Difference & 44.20 & 14.36 & 4.54 & .957 & 10 & .746\
bottomrule
end{tabularx}
caption{Testing Testing Testing%
label{tab:test1234}%
}
end{table}
end{document}
add a comment |
I would rather replace the vertical line with a supplementary empty column to have a clear separation between the two group of columns. Another possibility, aesthetically, might be to delete the vertical padding of horizontal rules, and replace it with the makegapedcells
command from makecell
, which adds a vertical space at the top and bottom of all cells. As a demonstration, I replaced the vertical line with thick, light grey vrule, which I find more pleasing to the eye than the default thin, black, vertical rule.
documentclass{article}
usepackage{makecell} % for bold in table using small
renewcommandtheadfont{smallbfseries} % for bold in table using small
usepackage{tabularx, ragged2e}
usepackage{booktabs}
usepackage[table, svgnames]{xcolor}
begin{document}
begin{table}[!ht]
centering
begin{tabularx}{textwidth}{X>{raggedrightarraybackslash}ccccccc}
toprule
& multicolumn{3}{c}{textbf{Paired Differences1}} & & multicolumn{3}{c}{textbf{Paired Differences2}}\
cmidrule(lr){2-4} cmidrule(lr){6-8}
& thead{Statistic}
& thead{df }
& thead{ Sig. }
& & thead{Statistic}
& thead{df}
& thead{Sig.} \
midrule
Difference & 44.20 & 14.36 & 4.54 & & .957 & 10 & .746\
bottomrule
end{tabularx}
caption{Testing Testing Testing%
label{tab:test1234}%
}
end{table}
begin{table}[!ht]
centering
setlength{aboverulesep}{0pt}
setlength{belowrulesep}{0pt}
setcellgapes{3pt}makegapedcells
begin{tabularx}{textwidth}{X>{raggedrightarraybackslash}ccc!{color{Gainsboro!50!Lavender}vline width 0.75em}ccc}
toprule
& multicolumn{3}{c!{color{Gainsboro!50!Lavender}vline width 0.75em}}{textbf{Paired Differences1}} & multicolumn{3}{c}{textbf{Paired Differences2}}\noalign{vskip -0.033em}
cmidrule(lr{1.33em}){2-4} cmidrule(lr){5-7}
& thead{Statistic}
& thead{df}
& thead{Sig.}
& thead{Statistic}
& thead{df}
& thead{Sig.} \
noalign{vskip-0.05em}
cmidrule[0.05em](r{0.9em}){1-4}cmidrule[0.05em](l{0.15em}){5-7}
Difference & 44.20 & 14.36 & 4.54 & .957 & 10 & .746\
bottomrule
end{tabularx}
caption{Testing Testing Testing%
label{tab:test1234}%
}
end{table}
end{document}
add a comment |
I would rather replace the vertical line with a supplementary empty column to have a clear separation between the two group of columns. Another possibility, aesthetically, might be to delete the vertical padding of horizontal rules, and replace it with the makegapedcells
command from makecell
, which adds a vertical space at the top and bottom of all cells. As a demonstration, I replaced the vertical line with thick, light grey vrule, which I find more pleasing to the eye than the default thin, black, vertical rule.
documentclass{article}
usepackage{makecell} % for bold in table using small
renewcommandtheadfont{smallbfseries} % for bold in table using small
usepackage{tabularx, ragged2e}
usepackage{booktabs}
usepackage[table, svgnames]{xcolor}
begin{document}
begin{table}[!ht]
centering
begin{tabularx}{textwidth}{X>{raggedrightarraybackslash}ccccccc}
toprule
& multicolumn{3}{c}{textbf{Paired Differences1}} & & multicolumn{3}{c}{textbf{Paired Differences2}}\
cmidrule(lr){2-4} cmidrule(lr){6-8}
& thead{Statistic}
& thead{df }
& thead{ Sig. }
& & thead{Statistic}
& thead{df}
& thead{Sig.} \
midrule
Difference & 44.20 & 14.36 & 4.54 & & .957 & 10 & .746\
bottomrule
end{tabularx}
caption{Testing Testing Testing%
label{tab:test1234}%
}
end{table}
begin{table}[!ht]
centering
setlength{aboverulesep}{0pt}
setlength{belowrulesep}{0pt}
setcellgapes{3pt}makegapedcells
begin{tabularx}{textwidth}{X>{raggedrightarraybackslash}ccc!{color{Gainsboro!50!Lavender}vline width 0.75em}ccc}
toprule
& multicolumn{3}{c!{color{Gainsboro!50!Lavender}vline width 0.75em}}{textbf{Paired Differences1}} & multicolumn{3}{c}{textbf{Paired Differences2}}\noalign{vskip -0.033em}
cmidrule(lr{1.33em}){2-4} cmidrule(lr){5-7}
& thead{Statistic}
& thead{df}
& thead{Sig.}
& thead{Statistic}
& thead{df}
& thead{Sig.} \
noalign{vskip-0.05em}
cmidrule[0.05em](r{0.9em}){1-4}cmidrule[0.05em](l{0.15em}){5-7}
Difference & 44.20 & 14.36 & 4.54 & .957 & 10 & .746\
bottomrule
end{tabularx}
caption{Testing Testing Testing%
label{tab:test1234}%
}
end{table}
end{document}
I would rather replace the vertical line with a supplementary empty column to have a clear separation between the two group of columns. Another possibility, aesthetically, might be to delete the vertical padding of horizontal rules, and replace it with the makegapedcells
command from makecell
, which adds a vertical space at the top and bottom of all cells. As a demonstration, I replaced the vertical line with thick, light grey vrule, which I find more pleasing to the eye than the default thin, black, vertical rule.
documentclass{article}
usepackage{makecell} % for bold in table using small
renewcommandtheadfont{smallbfseries} % for bold in table using small
usepackage{tabularx, ragged2e}
usepackage{booktabs}
usepackage[table, svgnames]{xcolor}
begin{document}
begin{table}[!ht]
centering
begin{tabularx}{textwidth}{X>{raggedrightarraybackslash}ccccccc}
toprule
& multicolumn{3}{c}{textbf{Paired Differences1}} & & multicolumn{3}{c}{textbf{Paired Differences2}}\
cmidrule(lr){2-4} cmidrule(lr){6-8}
& thead{Statistic}
& thead{df }
& thead{ Sig. }
& & thead{Statistic}
& thead{df}
& thead{Sig.} \
midrule
Difference & 44.20 & 14.36 & 4.54 & & .957 & 10 & .746\
bottomrule
end{tabularx}
caption{Testing Testing Testing%
label{tab:test1234}%
}
end{table}
begin{table}[!ht]
centering
setlength{aboverulesep}{0pt}
setlength{belowrulesep}{0pt}
setcellgapes{3pt}makegapedcells
begin{tabularx}{textwidth}{X>{raggedrightarraybackslash}ccc!{color{Gainsboro!50!Lavender}vline width 0.75em}ccc}
toprule
& multicolumn{3}{c!{color{Gainsboro!50!Lavender}vline width 0.75em}}{textbf{Paired Differences1}} & multicolumn{3}{c}{textbf{Paired Differences2}}\noalign{vskip -0.033em}
cmidrule(lr{1.33em}){2-4} cmidrule(lr){5-7}
& thead{Statistic}
& thead{df}
& thead{Sig.}
& thead{Statistic}
& thead{df}
& thead{Sig.} \
noalign{vskip-0.05em}
cmidrule[0.05em](r{0.9em}){1-4}cmidrule[0.05em](l{0.15em}){5-7}
Difference & 44.20 & 14.36 & 4.54 & .957 & 10 & .746\
bottomrule
end{tabularx}
caption{Testing Testing Testing%
label{tab:test1234}%
}
end{table}
end{document}
edited 7 hours ago
answered 7 hours ago
BernardBernard
187k7 gold badges84 silver badges221 bronze badges
187k7 gold badges84 silver badges221 bronze badges
add a comment |
add a comment |
With combination of S
and X
columns type, without vertical lines, with rounded numbers ... :
documentclass{article}
usepackage{booktabs, tabularx}
usepackage{xparse}
NewExpandableDocumentCommandmcx{O{1}m}
{multicolumn{#1}{>{Centeringsmallbfserieshsize=#1hsize}X}{#2}}
usepackage{ragged2e}
usepackage{siunitx}
begin{document}
begin{table}[ht]
centering
setlengthtabcolsep{0pt}
sisetup{round-integer-to-decimal,
round-mode=places,
table-format=2.2}
begin{tabularx}{linewidth}{l *{6}{S} }
toprule
& mcx[3]{Paired Differences 1}
& mcx[3]{Paired Differences 2} \
cmidrule(r){2-4}cmidrule(l){5-7}
& mcx{Statistic} & mcx{df} & mcx{Sig.}
& mcx{Statistic} & mcx{df} & mcx{Sig.} \
midrule
Difference
& 44.20 & 14.36 & 4.54 & 0.957 & 10 & 0.746 \
bottomrule
end{tabularx}
caption{Testing Testing Testing}
label{tab:test1234}
end{table}
end{document}
add a comment |
With combination of S
and X
columns type, without vertical lines, with rounded numbers ... :
documentclass{article}
usepackage{booktabs, tabularx}
usepackage{xparse}
NewExpandableDocumentCommandmcx{O{1}m}
{multicolumn{#1}{>{Centeringsmallbfserieshsize=#1hsize}X}{#2}}
usepackage{ragged2e}
usepackage{siunitx}
begin{document}
begin{table}[ht]
centering
setlengthtabcolsep{0pt}
sisetup{round-integer-to-decimal,
round-mode=places,
table-format=2.2}
begin{tabularx}{linewidth}{l *{6}{S} }
toprule
& mcx[3]{Paired Differences 1}
& mcx[3]{Paired Differences 2} \
cmidrule(r){2-4}cmidrule(l){5-7}
& mcx{Statistic} & mcx{df} & mcx{Sig.}
& mcx{Statistic} & mcx{df} & mcx{Sig.} \
midrule
Difference
& 44.20 & 14.36 & 4.54 & 0.957 & 10 & 0.746 \
bottomrule
end{tabularx}
caption{Testing Testing Testing}
label{tab:test1234}
end{table}
end{document}
add a comment |
With combination of S
and X
columns type, without vertical lines, with rounded numbers ... :
documentclass{article}
usepackage{booktabs, tabularx}
usepackage{xparse}
NewExpandableDocumentCommandmcx{O{1}m}
{multicolumn{#1}{>{Centeringsmallbfserieshsize=#1hsize}X}{#2}}
usepackage{ragged2e}
usepackage{siunitx}
begin{document}
begin{table}[ht]
centering
setlengthtabcolsep{0pt}
sisetup{round-integer-to-decimal,
round-mode=places,
table-format=2.2}
begin{tabularx}{linewidth}{l *{6}{S} }
toprule
& mcx[3]{Paired Differences 1}
& mcx[3]{Paired Differences 2} \
cmidrule(r){2-4}cmidrule(l){5-7}
& mcx{Statistic} & mcx{df} & mcx{Sig.}
& mcx{Statistic} & mcx{df} & mcx{Sig.} \
midrule
Difference
& 44.20 & 14.36 & 4.54 & 0.957 & 10 & 0.746 \
bottomrule
end{tabularx}
caption{Testing Testing Testing}
label{tab:test1234}
end{table}
end{document}
With combination of S
and X
columns type, without vertical lines, with rounded numbers ... :
documentclass{article}
usepackage{booktabs, tabularx}
usepackage{xparse}
NewExpandableDocumentCommandmcx{O{1}m}
{multicolumn{#1}{>{Centeringsmallbfserieshsize=#1hsize}X}{#2}}
usepackage{ragged2e}
usepackage{siunitx}
begin{document}
begin{table}[ht]
centering
setlengthtabcolsep{0pt}
sisetup{round-integer-to-decimal,
round-mode=places,
table-format=2.2}
begin{tabularx}{linewidth}{l *{6}{S} }
toprule
& mcx[3]{Paired Differences 1}
& mcx[3]{Paired Differences 2} \
cmidrule(r){2-4}cmidrule(l){5-7}
& mcx{Statistic} & mcx{df} & mcx{Sig.}
& mcx{Statistic} & mcx{df} & mcx{Sig.} \
midrule
Difference
& 44.20 & 14.36 & 4.54 & 0.957 & 10 & 0.746 \
bottomrule
end{tabularx}
caption{Testing Testing Testing}
label{tab:test1234}
end{table}
end{document}
edited 6 hours ago
answered 7 hours ago
ZarkoZarko
143k8 gold badges79 silver badges192 bronze badges
143k8 gold badges79 silver badges192 bronze badges
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%2f503806%2fcontinuous-vertical-line-using-booktabs-in-tabularx-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
1
A tabularx environment requires at least one
X
column to make sense. This answers you second question. As to the first,booktabs
is not adapted to vertical rules. For which reason do you ue it?– Bernard
8 hours ago
3
To quote from the
booktabs
manual: "You will not go far wrong if you remember two simple guidelines at all times: 1. Never, ever use vertical rules. [...]" Therefore, I'd recommend to either stick to this rule, or, if you prefer vertical lines, usehline
instead of tehbooktabs
horizontal lines.– leandriis
8 hours ago
Please also note, that oyu can remove
small
from athead
commands, as you already usedrenewcommandtheadfont{small}´ to automatically make all text in
thead` commands small. You can go even further and remove all thetextbf
inside ofthead
commands, if you userenewcommandtheadfont{smallbfseries}
– leandriis
8 hours ago
Regarding "the simplest method to maximise the width of a table" where would you like the extra white space to be? Between column 1 and 2, or 4 and 5 or equally distributed between all columns? Are there entries in the first column that are wider than the shown one? Why would wou even want your table to be wieder than it currently is?
– leandriis
8 hours ago
1
Regarding the vertical lines, you might also want to have a loom at Vertical table lines are discontinuous with booktabs
– leandriis
8 hours ago