How to align table contents by decimal point?
I've searched online and on this forum. I haven't found an appropriate solution to my issue. I am trying to align the numbers in my table with their decimal point. I'm not exactly sure how to go about doing this.
I'd greatly appreciate any help!
documentclass[12pt, a4paper]{report}
usepackage{setspace}
usepackage{amsmath}
usepackage{tabularx,booktabs}
oddsidemargin-1cm
textwidth17cm
defCOMP#1{begin{tabular}{c}#1end{tabular}}
newcolumntype{L}{>{$}l<{$}}
newcolumntype{C}{>{$}c<{$}}
newcolumntype{R}{>{$}r<{$}}
begin{document}
begin{table} [h!]
centering
%resizebox{textwidth}{!} {%
begin{tabular}{LCCCCCCCCC}
toprule
multicolumn{1}{l}{} &
multicolumn{3}{c}{2007 - 2011} &
multicolumn{3}{c}{2007 - 2012} &
multicolumn{3}{c}{2007 - 2013} \
cmidrule(lr){2-4}
cmidrule(lr){5-7}
cmidrule(lr){8-10}
&
multicolumn{1}{c}{COMP{Coeff.}} &
multicolumn{1}{c}{COMP{C.S.E.} }&
multicolumn{1}{c}{COMP{S.E}} &
multicolumn{1}{c}{COMP{Coeff.}} &
multicolumn{1}{c}{COMP{C.S.E.}} &
multicolumn{1}{c}{COMP{S.E.}} &
multicolumn{1}{c}{COMP{Coeff.}} &
multicolumn{1}{c}{COMP{C.S.E}} &
multicolumn{1}{c}{COMP{S.E.}} \
midrule
Black &-0.029 & 0.004^* & 0.096 & 0.018 & 0.007 & 0.092 & 0.019 & 0.016 & 0.092 \
Male & 0.043 & 0.003^{**} & 0.136 & 0.030 & 0.008 & 0.135 & -0.048 & 0.019 & 0.122 \
Female & -0.009 & 0.006 & 0.131 & 0.019 & 0.008 & 0.123 & -0.007 & 0.016 & 0.142 \
\
Asian & 0.021 & 0.002^* & 0.129 & 0.006 & 0.006 & 0.119 & -0.065 & 0.002^{**} & 0.121 \
Male & -0.056 & 0.005^* & 0.192 & 0.144 & 0.004^{**} & 0.175 & -0.124 & 0.010^* & 0.170 \
Female & 0.095 & 0.001^{***} & 0.171 & -0.097 & 0.007^{**} & 0.159 & -0.049 & 0.004^{**} & 0.175 \
\
Hispanic & -0.111 & 0.001^{***} & 0.049^* & -0.161 & 0.001^{***} & 0.049^{***} & -0.181 & 0.002^{***} & 0.048^{***} \
Male & -0.136 & 0.001^{***} & 0.066^{**} & -0.169 & 0.001^{***} & 0.067^{**} & -0.223 & 0.001^{***} & 0.064^{***} \
Female & -0.065 & 0.002^{**} & 0.076 & -0.138 & 0.001^{***} & 0.073^* & -0.130 & 0.001^{***} & 0.076^* \
\
W. Female & 0.023 & 0.001^{**} & 0.049 & 0.035 & 0.001^{**} & 0.049 & -0.059 & 0.001^{***} & 0.049 \
bottomrule
end{tabular}
caption{Triple Differences Estimates}label{beta}
end{table}

tables align tabularx booktabs
New contributor
Aaron is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
I've searched online and on this forum. I haven't found an appropriate solution to my issue. I am trying to align the numbers in my table with their decimal point. I'm not exactly sure how to go about doing this.
I'd greatly appreciate any help!
documentclass[12pt, a4paper]{report}
usepackage{setspace}
usepackage{amsmath}
usepackage{tabularx,booktabs}
oddsidemargin-1cm
textwidth17cm
defCOMP#1{begin{tabular}{c}#1end{tabular}}
newcolumntype{L}{>{$}l<{$}}
newcolumntype{C}{>{$}c<{$}}
newcolumntype{R}{>{$}r<{$}}
begin{document}
begin{table} [h!]
centering
%resizebox{textwidth}{!} {%
begin{tabular}{LCCCCCCCCC}
toprule
multicolumn{1}{l}{} &
multicolumn{3}{c}{2007 - 2011} &
multicolumn{3}{c}{2007 - 2012} &
multicolumn{3}{c}{2007 - 2013} \
cmidrule(lr){2-4}
cmidrule(lr){5-7}
cmidrule(lr){8-10}
&
multicolumn{1}{c}{COMP{Coeff.}} &
multicolumn{1}{c}{COMP{C.S.E.} }&
multicolumn{1}{c}{COMP{S.E}} &
multicolumn{1}{c}{COMP{Coeff.}} &
multicolumn{1}{c}{COMP{C.S.E.}} &
multicolumn{1}{c}{COMP{S.E.}} &
multicolumn{1}{c}{COMP{Coeff.}} &
multicolumn{1}{c}{COMP{C.S.E}} &
multicolumn{1}{c}{COMP{S.E.}} \
midrule
Black &-0.029 & 0.004^* & 0.096 & 0.018 & 0.007 & 0.092 & 0.019 & 0.016 & 0.092 \
Male & 0.043 & 0.003^{**} & 0.136 & 0.030 & 0.008 & 0.135 & -0.048 & 0.019 & 0.122 \
Female & -0.009 & 0.006 & 0.131 & 0.019 & 0.008 & 0.123 & -0.007 & 0.016 & 0.142 \
\
Asian & 0.021 & 0.002^* & 0.129 & 0.006 & 0.006 & 0.119 & -0.065 & 0.002^{**} & 0.121 \
Male & -0.056 & 0.005^* & 0.192 & 0.144 & 0.004^{**} & 0.175 & -0.124 & 0.010^* & 0.170 \
Female & 0.095 & 0.001^{***} & 0.171 & -0.097 & 0.007^{**} & 0.159 & -0.049 & 0.004^{**} & 0.175 \
\
Hispanic & -0.111 & 0.001^{***} & 0.049^* & -0.161 & 0.001^{***} & 0.049^{***} & -0.181 & 0.002^{***} & 0.048^{***} \
Male & -0.136 & 0.001^{***} & 0.066^{**} & -0.169 & 0.001^{***} & 0.067^{**} & -0.223 & 0.001^{***} & 0.064^{***} \
Female & -0.065 & 0.002^{**} & 0.076 & -0.138 & 0.001^{***} & 0.073^* & -0.130 & 0.001^{***} & 0.076^* \
\
W. Female & 0.023 & 0.001^{**} & 0.049 & 0.035 & 0.001^{**} & 0.049 & -0.059 & 0.001^{***} & 0.049 \
bottomrule
end{tabular}
caption{Triple Differences Estimates}label{beta}
end{table}

tables align tabularx booktabs
New contributor
Aaron is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1
Welcome to TeX SX! What are theLandCcolumn types?
– Bernard
1 hour ago
Apologies, forgot to add a section of code. It's been edited!
– Aaron
1 hour ago
look at thesiunitxpackage
– JPi
1 hour ago
add a comment |
I've searched online and on this forum. I haven't found an appropriate solution to my issue. I am trying to align the numbers in my table with their decimal point. I'm not exactly sure how to go about doing this.
I'd greatly appreciate any help!
documentclass[12pt, a4paper]{report}
usepackage{setspace}
usepackage{amsmath}
usepackage{tabularx,booktabs}
oddsidemargin-1cm
textwidth17cm
defCOMP#1{begin{tabular}{c}#1end{tabular}}
newcolumntype{L}{>{$}l<{$}}
newcolumntype{C}{>{$}c<{$}}
newcolumntype{R}{>{$}r<{$}}
begin{document}
begin{table} [h!]
centering
%resizebox{textwidth}{!} {%
begin{tabular}{LCCCCCCCCC}
toprule
multicolumn{1}{l}{} &
multicolumn{3}{c}{2007 - 2011} &
multicolumn{3}{c}{2007 - 2012} &
multicolumn{3}{c}{2007 - 2013} \
cmidrule(lr){2-4}
cmidrule(lr){5-7}
cmidrule(lr){8-10}
&
multicolumn{1}{c}{COMP{Coeff.}} &
multicolumn{1}{c}{COMP{C.S.E.} }&
multicolumn{1}{c}{COMP{S.E}} &
multicolumn{1}{c}{COMP{Coeff.}} &
multicolumn{1}{c}{COMP{C.S.E.}} &
multicolumn{1}{c}{COMP{S.E.}} &
multicolumn{1}{c}{COMP{Coeff.}} &
multicolumn{1}{c}{COMP{C.S.E}} &
multicolumn{1}{c}{COMP{S.E.}} \
midrule
Black &-0.029 & 0.004^* & 0.096 & 0.018 & 0.007 & 0.092 & 0.019 & 0.016 & 0.092 \
Male & 0.043 & 0.003^{**} & 0.136 & 0.030 & 0.008 & 0.135 & -0.048 & 0.019 & 0.122 \
Female & -0.009 & 0.006 & 0.131 & 0.019 & 0.008 & 0.123 & -0.007 & 0.016 & 0.142 \
\
Asian & 0.021 & 0.002^* & 0.129 & 0.006 & 0.006 & 0.119 & -0.065 & 0.002^{**} & 0.121 \
Male & -0.056 & 0.005^* & 0.192 & 0.144 & 0.004^{**} & 0.175 & -0.124 & 0.010^* & 0.170 \
Female & 0.095 & 0.001^{***} & 0.171 & -0.097 & 0.007^{**} & 0.159 & -0.049 & 0.004^{**} & 0.175 \
\
Hispanic & -0.111 & 0.001^{***} & 0.049^* & -0.161 & 0.001^{***} & 0.049^{***} & -0.181 & 0.002^{***} & 0.048^{***} \
Male & -0.136 & 0.001^{***} & 0.066^{**} & -0.169 & 0.001^{***} & 0.067^{**} & -0.223 & 0.001^{***} & 0.064^{***} \
Female & -0.065 & 0.002^{**} & 0.076 & -0.138 & 0.001^{***} & 0.073^* & -0.130 & 0.001^{***} & 0.076^* \
\
W. Female & 0.023 & 0.001^{**} & 0.049 & 0.035 & 0.001^{**} & 0.049 & -0.059 & 0.001^{***} & 0.049 \
bottomrule
end{tabular}
caption{Triple Differences Estimates}label{beta}
end{table}

tables align tabularx booktabs
New contributor
Aaron is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
I've searched online and on this forum. I haven't found an appropriate solution to my issue. I am trying to align the numbers in my table with their decimal point. I'm not exactly sure how to go about doing this.
I'd greatly appreciate any help!
documentclass[12pt, a4paper]{report}
usepackage{setspace}
usepackage{amsmath}
usepackage{tabularx,booktabs}
oddsidemargin-1cm
textwidth17cm
defCOMP#1{begin{tabular}{c}#1end{tabular}}
newcolumntype{L}{>{$}l<{$}}
newcolumntype{C}{>{$}c<{$}}
newcolumntype{R}{>{$}r<{$}}
begin{document}
begin{table} [h!]
centering
%resizebox{textwidth}{!} {%
begin{tabular}{LCCCCCCCCC}
toprule
multicolumn{1}{l}{} &
multicolumn{3}{c}{2007 - 2011} &
multicolumn{3}{c}{2007 - 2012} &
multicolumn{3}{c}{2007 - 2013} \
cmidrule(lr){2-4}
cmidrule(lr){5-7}
cmidrule(lr){8-10}
&
multicolumn{1}{c}{COMP{Coeff.}} &
multicolumn{1}{c}{COMP{C.S.E.} }&
multicolumn{1}{c}{COMP{S.E}} &
multicolumn{1}{c}{COMP{Coeff.}} &
multicolumn{1}{c}{COMP{C.S.E.}} &
multicolumn{1}{c}{COMP{S.E.}} &
multicolumn{1}{c}{COMP{Coeff.}} &
multicolumn{1}{c}{COMP{C.S.E}} &
multicolumn{1}{c}{COMP{S.E.}} \
midrule
Black &-0.029 & 0.004^* & 0.096 & 0.018 & 0.007 & 0.092 & 0.019 & 0.016 & 0.092 \
Male & 0.043 & 0.003^{**} & 0.136 & 0.030 & 0.008 & 0.135 & -0.048 & 0.019 & 0.122 \
Female & -0.009 & 0.006 & 0.131 & 0.019 & 0.008 & 0.123 & -0.007 & 0.016 & 0.142 \
\
Asian & 0.021 & 0.002^* & 0.129 & 0.006 & 0.006 & 0.119 & -0.065 & 0.002^{**} & 0.121 \
Male & -0.056 & 0.005^* & 0.192 & 0.144 & 0.004^{**} & 0.175 & -0.124 & 0.010^* & 0.170 \
Female & 0.095 & 0.001^{***} & 0.171 & -0.097 & 0.007^{**} & 0.159 & -0.049 & 0.004^{**} & 0.175 \
\
Hispanic & -0.111 & 0.001^{***} & 0.049^* & -0.161 & 0.001^{***} & 0.049^{***} & -0.181 & 0.002^{***} & 0.048^{***} \
Male & -0.136 & 0.001^{***} & 0.066^{**} & -0.169 & 0.001^{***} & 0.067^{**} & -0.223 & 0.001^{***} & 0.064^{***} \
Female & -0.065 & 0.002^{**} & 0.076 & -0.138 & 0.001^{***} & 0.073^* & -0.130 & 0.001^{***} & 0.076^* \
\
W. Female & 0.023 & 0.001^{**} & 0.049 & 0.035 & 0.001^{**} & 0.049 & -0.059 & 0.001^{***} & 0.049 \
bottomrule
end{tabular}
caption{Triple Differences Estimates}label{beta}
end{table}

tables align tabularx booktabs
tables align tabularx booktabs
New contributor
Aaron is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Aaron is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
edited 1 hour ago
Aaron
New contributor
Aaron is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked 1 hour ago
AaronAaron
31
31
New contributor
Aaron is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Aaron is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Aaron is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1
Welcome to TeX SX! What are theLandCcolumn types?
– Bernard
1 hour ago
Apologies, forgot to add a section of code. It's been edited!
– Aaron
1 hour ago
look at thesiunitxpackage
– JPi
1 hour ago
add a comment |
1
Welcome to TeX SX! What are theLandCcolumn types?
– Bernard
1 hour ago
Apologies, forgot to add a section of code. It's been edited!
– Aaron
1 hour ago
look at thesiunitxpackage
– JPi
1 hour ago
1
1
Welcome to TeX SX! What are the
L and C column types?– Bernard
1 hour ago
Welcome to TeX SX! What are the
L and C column types?– Bernard
1 hour ago
Apologies, forgot to add a section of code. It's been edited!
– Aaron
1 hour ago
Apologies, forgot to add a section of code. It's been edited!
– Aaron
1 hour ago
look at the
siunitx package– JPi
1 hour ago
look at the
siunitx package– JPi
1 hour ago
add a comment |
1 Answer
1
active
oldest
votes
AS mentioned in a comment, this is best dine with siunitx. I took the opportunity to add some improvements. Just one observation: don't use mathmode to obtain italic text – the interletter spacing is not good.
documentclass[12pt, a4paper]{report}
usepackage{setspace}
usepackage{amsmath}
usepackage{tabularx, booktabs, siunitx, caption}
oddsidemargin-1cm
textwidth17cm
defCOMP#1{begin{tabular}{c}#1end{tabular}}
%
letts = textsuperscript
begin{document}
begin{table} [h!]
centering
caption{Triple Differences Estimates}label{beta}
setlength{tabcolsep}{4pt}
setlength{defaultaddspace}{1.5ex}
sisetup{table-format=1.3, table-number-alignment=center}
begin{tabular}{ >{itshape}l*{3}{S[table-format=-1.3]S[table-space-text-post=$ ^{***}$]S[table-space-text-post=$^{***}$]} }
toprule
multicolumn{1}{l}{} &
multicolumn{3}{c}{2007 - 2011} &
multicolumn{3}{c}{2007 - 2012} &
multicolumn{3}{c}{2007 - 2013} \
cmidrule(lr{1em}){2-4}
cmidrule(lr{1em}){5-7}
cmidrule(lr{1em}){8-10}
&
{Coeff.} &
{C.S.E.} &
{S.E} &
{Coeff.} &
{C.S.E.} &
{S.E.} &
{Coeff.} &
{C.S.E} &
{S.E.} \
midrule
Black &-0.029 & 0.004{ts*} & 0.096 & 0.018 & 0.007 & 0.092 & 0.019 & 0.016 & 0.092 \
Male & 0.043 & 0.003{ts{**}} & 0.136 & 0.030 & 0.008 & 0.135 & -0.048 & 0.019 & 0.122 \
Female & -0.009 & 0.006 & 0.131 & 0.019 & 0.008 & 0.123 & -0.007 & 0.016 & 0.142 \
addlinespace
Asian & 0.021 & 0.002{ts{*}} & 0.129 & 0.006 & 0.006 & 0.119 & -0.065 & 0.002{ts{**}} & 0.121 \
Male & -0.056 & 0.005{ts{*}} & 0.192 & 0.144 & 0.004{ts{**}} & 0.175 & -0.124 & 0.010{ts{*}} & 0.170 \
Female & 0.095 & 0.001{ts{***}} & 0.171 & -0.097 & 0.007{ts{**}} & 0.159 & -0.049 & 0.004{ts{**}} & 0.175 \
addlinespace
Hispanic & -0.111 & 0.001{ts{***}} & 0.049{ts{*}} & -0.161 & 0.001{ts{***}} & 0.049{ts{***}} & -0.181 & 0.002{ts{***}} & 0.048{ts{***}} \
Male & -0.136 & 0.001{ts{***}} & 0.066{ts{**}} & -0.169 & 0.001{ts{***}} & 0.067{ts{**}} & -0.223 & 0.001{ts{***}} & 0.064{ts{***}} \
Female & -0.065 & 0.002{ts{**}} & 0.076 & -0.138 & 0.001{ts{***}} & 0.073{ts{*}} & -0.130 & 0.001{ts{***}} & 0.076{ts{*}} \
addlinespace
W. Female & 0.023 & 0.001{ts{**}} & 0.049 & 0.035 & 0.001{ts{**}} & 0.049 & -0.059 & 0.001{ts{***}} & 0.049 \
bottomrule
end{tabular}
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
});
}
});
Aaron is a new contributor. Be nice, and check out our Code of Conduct.
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%2f480007%2fhow-to-align-table-contents-by-decimal-point%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
AS mentioned in a comment, this is best dine with siunitx. I took the opportunity to add some improvements. Just one observation: don't use mathmode to obtain italic text – the interletter spacing is not good.
documentclass[12pt, a4paper]{report}
usepackage{setspace}
usepackage{amsmath}
usepackage{tabularx, booktabs, siunitx, caption}
oddsidemargin-1cm
textwidth17cm
defCOMP#1{begin{tabular}{c}#1end{tabular}}
%
letts = textsuperscript
begin{document}
begin{table} [h!]
centering
caption{Triple Differences Estimates}label{beta}
setlength{tabcolsep}{4pt}
setlength{defaultaddspace}{1.5ex}
sisetup{table-format=1.3, table-number-alignment=center}
begin{tabular}{ >{itshape}l*{3}{S[table-format=-1.3]S[table-space-text-post=$ ^{***}$]S[table-space-text-post=$^{***}$]} }
toprule
multicolumn{1}{l}{} &
multicolumn{3}{c}{2007 - 2011} &
multicolumn{3}{c}{2007 - 2012} &
multicolumn{3}{c}{2007 - 2013} \
cmidrule(lr{1em}){2-4}
cmidrule(lr{1em}){5-7}
cmidrule(lr{1em}){8-10}
&
{Coeff.} &
{C.S.E.} &
{S.E} &
{Coeff.} &
{C.S.E.} &
{S.E.} &
{Coeff.} &
{C.S.E} &
{S.E.} \
midrule
Black &-0.029 & 0.004{ts*} & 0.096 & 0.018 & 0.007 & 0.092 & 0.019 & 0.016 & 0.092 \
Male & 0.043 & 0.003{ts{**}} & 0.136 & 0.030 & 0.008 & 0.135 & -0.048 & 0.019 & 0.122 \
Female & -0.009 & 0.006 & 0.131 & 0.019 & 0.008 & 0.123 & -0.007 & 0.016 & 0.142 \
addlinespace
Asian & 0.021 & 0.002{ts{*}} & 0.129 & 0.006 & 0.006 & 0.119 & -0.065 & 0.002{ts{**}} & 0.121 \
Male & -0.056 & 0.005{ts{*}} & 0.192 & 0.144 & 0.004{ts{**}} & 0.175 & -0.124 & 0.010{ts{*}} & 0.170 \
Female & 0.095 & 0.001{ts{***}} & 0.171 & -0.097 & 0.007{ts{**}} & 0.159 & -0.049 & 0.004{ts{**}} & 0.175 \
addlinespace
Hispanic & -0.111 & 0.001{ts{***}} & 0.049{ts{*}} & -0.161 & 0.001{ts{***}} & 0.049{ts{***}} & -0.181 & 0.002{ts{***}} & 0.048{ts{***}} \
Male & -0.136 & 0.001{ts{***}} & 0.066{ts{**}} & -0.169 & 0.001{ts{***}} & 0.067{ts{**}} & -0.223 & 0.001{ts{***}} & 0.064{ts{***}} \
Female & -0.065 & 0.002{ts{**}} & 0.076 & -0.138 & 0.001{ts{***}} & 0.073{ts{*}} & -0.130 & 0.001{ts{***}} & 0.076{ts{*}} \
addlinespace
W. Female & 0.023 & 0.001{ts{**}} & 0.049 & 0.035 & 0.001{ts{**}} & 0.049 & -0.059 & 0.001{ts{***}} & 0.049 \
bottomrule
end{tabular}
end{table}
end{document}

add a comment |
AS mentioned in a comment, this is best dine with siunitx. I took the opportunity to add some improvements. Just one observation: don't use mathmode to obtain italic text – the interletter spacing is not good.
documentclass[12pt, a4paper]{report}
usepackage{setspace}
usepackage{amsmath}
usepackage{tabularx, booktabs, siunitx, caption}
oddsidemargin-1cm
textwidth17cm
defCOMP#1{begin{tabular}{c}#1end{tabular}}
%
letts = textsuperscript
begin{document}
begin{table} [h!]
centering
caption{Triple Differences Estimates}label{beta}
setlength{tabcolsep}{4pt}
setlength{defaultaddspace}{1.5ex}
sisetup{table-format=1.3, table-number-alignment=center}
begin{tabular}{ >{itshape}l*{3}{S[table-format=-1.3]S[table-space-text-post=$ ^{***}$]S[table-space-text-post=$^{***}$]} }
toprule
multicolumn{1}{l}{} &
multicolumn{3}{c}{2007 - 2011} &
multicolumn{3}{c}{2007 - 2012} &
multicolumn{3}{c}{2007 - 2013} \
cmidrule(lr{1em}){2-4}
cmidrule(lr{1em}){5-7}
cmidrule(lr{1em}){8-10}
&
{Coeff.} &
{C.S.E.} &
{S.E} &
{Coeff.} &
{C.S.E.} &
{S.E.} &
{Coeff.} &
{C.S.E} &
{S.E.} \
midrule
Black &-0.029 & 0.004{ts*} & 0.096 & 0.018 & 0.007 & 0.092 & 0.019 & 0.016 & 0.092 \
Male & 0.043 & 0.003{ts{**}} & 0.136 & 0.030 & 0.008 & 0.135 & -0.048 & 0.019 & 0.122 \
Female & -0.009 & 0.006 & 0.131 & 0.019 & 0.008 & 0.123 & -0.007 & 0.016 & 0.142 \
addlinespace
Asian & 0.021 & 0.002{ts{*}} & 0.129 & 0.006 & 0.006 & 0.119 & -0.065 & 0.002{ts{**}} & 0.121 \
Male & -0.056 & 0.005{ts{*}} & 0.192 & 0.144 & 0.004{ts{**}} & 0.175 & -0.124 & 0.010{ts{*}} & 0.170 \
Female & 0.095 & 0.001{ts{***}} & 0.171 & -0.097 & 0.007{ts{**}} & 0.159 & -0.049 & 0.004{ts{**}} & 0.175 \
addlinespace
Hispanic & -0.111 & 0.001{ts{***}} & 0.049{ts{*}} & -0.161 & 0.001{ts{***}} & 0.049{ts{***}} & -0.181 & 0.002{ts{***}} & 0.048{ts{***}} \
Male & -0.136 & 0.001{ts{***}} & 0.066{ts{**}} & -0.169 & 0.001{ts{***}} & 0.067{ts{**}} & -0.223 & 0.001{ts{***}} & 0.064{ts{***}} \
Female & -0.065 & 0.002{ts{**}} & 0.076 & -0.138 & 0.001{ts{***}} & 0.073{ts{*}} & -0.130 & 0.001{ts{***}} & 0.076{ts{*}} \
addlinespace
W. Female & 0.023 & 0.001{ts{**}} & 0.049 & 0.035 & 0.001{ts{**}} & 0.049 & -0.059 & 0.001{ts{***}} & 0.049 \
bottomrule
end{tabular}
end{table}
end{document}

add a comment |
AS mentioned in a comment, this is best dine with siunitx. I took the opportunity to add some improvements. Just one observation: don't use mathmode to obtain italic text – the interletter spacing is not good.
documentclass[12pt, a4paper]{report}
usepackage{setspace}
usepackage{amsmath}
usepackage{tabularx, booktabs, siunitx, caption}
oddsidemargin-1cm
textwidth17cm
defCOMP#1{begin{tabular}{c}#1end{tabular}}
%
letts = textsuperscript
begin{document}
begin{table} [h!]
centering
caption{Triple Differences Estimates}label{beta}
setlength{tabcolsep}{4pt}
setlength{defaultaddspace}{1.5ex}
sisetup{table-format=1.3, table-number-alignment=center}
begin{tabular}{ >{itshape}l*{3}{S[table-format=-1.3]S[table-space-text-post=$ ^{***}$]S[table-space-text-post=$^{***}$]} }
toprule
multicolumn{1}{l}{} &
multicolumn{3}{c}{2007 - 2011} &
multicolumn{3}{c}{2007 - 2012} &
multicolumn{3}{c}{2007 - 2013} \
cmidrule(lr{1em}){2-4}
cmidrule(lr{1em}){5-7}
cmidrule(lr{1em}){8-10}
&
{Coeff.} &
{C.S.E.} &
{S.E} &
{Coeff.} &
{C.S.E.} &
{S.E.} &
{Coeff.} &
{C.S.E} &
{S.E.} \
midrule
Black &-0.029 & 0.004{ts*} & 0.096 & 0.018 & 0.007 & 0.092 & 0.019 & 0.016 & 0.092 \
Male & 0.043 & 0.003{ts{**}} & 0.136 & 0.030 & 0.008 & 0.135 & -0.048 & 0.019 & 0.122 \
Female & -0.009 & 0.006 & 0.131 & 0.019 & 0.008 & 0.123 & -0.007 & 0.016 & 0.142 \
addlinespace
Asian & 0.021 & 0.002{ts{*}} & 0.129 & 0.006 & 0.006 & 0.119 & -0.065 & 0.002{ts{**}} & 0.121 \
Male & -0.056 & 0.005{ts{*}} & 0.192 & 0.144 & 0.004{ts{**}} & 0.175 & -0.124 & 0.010{ts{*}} & 0.170 \
Female & 0.095 & 0.001{ts{***}} & 0.171 & -0.097 & 0.007{ts{**}} & 0.159 & -0.049 & 0.004{ts{**}} & 0.175 \
addlinespace
Hispanic & -0.111 & 0.001{ts{***}} & 0.049{ts{*}} & -0.161 & 0.001{ts{***}} & 0.049{ts{***}} & -0.181 & 0.002{ts{***}} & 0.048{ts{***}} \
Male & -0.136 & 0.001{ts{***}} & 0.066{ts{**}} & -0.169 & 0.001{ts{***}} & 0.067{ts{**}} & -0.223 & 0.001{ts{***}} & 0.064{ts{***}} \
Female & -0.065 & 0.002{ts{**}} & 0.076 & -0.138 & 0.001{ts{***}} & 0.073{ts{*}} & -0.130 & 0.001{ts{***}} & 0.076{ts{*}} \
addlinespace
W. Female & 0.023 & 0.001{ts{**}} & 0.049 & 0.035 & 0.001{ts{**}} & 0.049 & -0.059 & 0.001{ts{***}} & 0.049 \
bottomrule
end{tabular}
end{table}
end{document}

AS mentioned in a comment, this is best dine with siunitx. I took the opportunity to add some improvements. Just one observation: don't use mathmode to obtain italic text – the interletter spacing is not good.
documentclass[12pt, a4paper]{report}
usepackage{setspace}
usepackage{amsmath}
usepackage{tabularx, booktabs, siunitx, caption}
oddsidemargin-1cm
textwidth17cm
defCOMP#1{begin{tabular}{c}#1end{tabular}}
%
letts = textsuperscript
begin{document}
begin{table} [h!]
centering
caption{Triple Differences Estimates}label{beta}
setlength{tabcolsep}{4pt}
setlength{defaultaddspace}{1.5ex}
sisetup{table-format=1.3, table-number-alignment=center}
begin{tabular}{ >{itshape}l*{3}{S[table-format=-1.3]S[table-space-text-post=$ ^{***}$]S[table-space-text-post=$^{***}$]} }
toprule
multicolumn{1}{l}{} &
multicolumn{3}{c}{2007 - 2011} &
multicolumn{3}{c}{2007 - 2012} &
multicolumn{3}{c}{2007 - 2013} \
cmidrule(lr{1em}){2-4}
cmidrule(lr{1em}){5-7}
cmidrule(lr{1em}){8-10}
&
{Coeff.} &
{C.S.E.} &
{S.E} &
{Coeff.} &
{C.S.E.} &
{S.E.} &
{Coeff.} &
{C.S.E} &
{S.E.} \
midrule
Black &-0.029 & 0.004{ts*} & 0.096 & 0.018 & 0.007 & 0.092 & 0.019 & 0.016 & 0.092 \
Male & 0.043 & 0.003{ts{**}} & 0.136 & 0.030 & 0.008 & 0.135 & -0.048 & 0.019 & 0.122 \
Female & -0.009 & 0.006 & 0.131 & 0.019 & 0.008 & 0.123 & -0.007 & 0.016 & 0.142 \
addlinespace
Asian & 0.021 & 0.002{ts{*}} & 0.129 & 0.006 & 0.006 & 0.119 & -0.065 & 0.002{ts{**}} & 0.121 \
Male & -0.056 & 0.005{ts{*}} & 0.192 & 0.144 & 0.004{ts{**}} & 0.175 & -0.124 & 0.010{ts{*}} & 0.170 \
Female & 0.095 & 0.001{ts{***}} & 0.171 & -0.097 & 0.007{ts{**}} & 0.159 & -0.049 & 0.004{ts{**}} & 0.175 \
addlinespace
Hispanic & -0.111 & 0.001{ts{***}} & 0.049{ts{*}} & -0.161 & 0.001{ts{***}} & 0.049{ts{***}} & -0.181 & 0.002{ts{***}} & 0.048{ts{***}} \
Male & -0.136 & 0.001{ts{***}} & 0.066{ts{**}} & -0.169 & 0.001{ts{***}} & 0.067{ts{**}} & -0.223 & 0.001{ts{***}} & 0.064{ts{***}} \
Female & -0.065 & 0.002{ts{**}} & 0.076 & -0.138 & 0.001{ts{***}} & 0.073{ts{*}} & -0.130 & 0.001{ts{***}} & 0.076{ts{*}} \
addlinespace
W. Female & 0.023 & 0.001{ts{**}} & 0.049 & 0.035 & 0.001{ts{**}} & 0.049 & -0.059 & 0.001{ts{***}} & 0.049 \
bottomrule
end{tabular}
end{table}
end{document}

answered 34 mins ago
BernardBernard
173k776204
173k776204
add a comment |
add a comment |
Aaron is a new contributor. Be nice, and check out our Code of Conduct.
Aaron is a new contributor. Be nice, and check out our Code of Conduct.
Aaron is a new contributor. Be nice, and check out our Code of Conduct.
Aaron is a new contributor. Be nice, and check out our Code of Conduct.
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%2f480007%2fhow-to-align-table-contents-by-decimal-point%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
Welcome to TeX SX! What are the
LandCcolumn types?– Bernard
1 hour ago
Apologies, forgot to add a section of code. It's been edited!
– Aaron
1 hour ago
look at the
siunitxpackage– JPi
1 hour ago