Issues Fitting Generated Table to Width
I have reviewed quite a few posts on here, yet everything seems to be breaking my table, so I figured I'd just post my probem and ask for help. I generated a table using https://www.tablesgenerator.com
I am having issues fitting my table to the width of the page without shrinking the text:
documentclass[acmsmall]{acmart}
usepackage{graphicx}
usepackage[table,xcdraw]{xcolor}
begin{table}
resizebox{textwidth}{!}{%
begin{tabular}{lcccccccccccc}
hline
rowcolor[HTML]{EFEFEF}
multicolumn{13}{c}{cellcolor[HTML]{EFEFEF}textbf{Title}} \ hline
textit{textbf{Hashtag}} & multicolumn{3}{c}
{textit{textbf{Service1}}} & multicolumn{3}{c}
{textit{textbf{Service2}}} & multicolumn{3}{c}
{textit{textbf{Service3}}} & multicolumn{3}{c}
{textit{textbf{Service4}}} \ hline
rowcolor[HTML]{EFEFEF}
textit{} & textit{True} & textit{False} & textit{Accuracy} &
textit{True} & textit{False} & textit{Accuracy} & textit{True} &
textit{False} & textit{Accuracy} & textit{True} & textit{False} &
textit{Accuracy} \ hline
textit{#1} & n & n & n% & x & x & x & n & n & n% & n &
n & n% \ hline
rowcolor[HTML]{EFEFEF}
textit{#2} & n & n & n% & x & x & x & n & n & n% & n &
n & n% \ hline
textit{#3} & n & n & n% & x & x & x & n & n & n% & n &
n & n% \ hline
rowcolor[HTML]{EFEFEF}
textit{#4} & n & n & n% & x & x & x & n& 100 & n% & n
& n & n% \ hline
begin{tabular}[c]{@{}l@{}}#5, \ #6, \ #7end{tabular} & n & n &
n% & n & n & n% & n & n & n% & n & n & n% \ hline
end{tabular}%
}
end{table}
tables
add a comment |
I have reviewed quite a few posts on here, yet everything seems to be breaking my table, so I figured I'd just post my probem and ask for help. I generated a table using https://www.tablesgenerator.com
I am having issues fitting my table to the width of the page without shrinking the text:
documentclass[acmsmall]{acmart}
usepackage{graphicx}
usepackage[table,xcdraw]{xcolor}
begin{table}
resizebox{textwidth}{!}{%
begin{tabular}{lcccccccccccc}
hline
rowcolor[HTML]{EFEFEF}
multicolumn{13}{c}{cellcolor[HTML]{EFEFEF}textbf{Title}} \ hline
textit{textbf{Hashtag}} & multicolumn{3}{c}
{textit{textbf{Service1}}} & multicolumn{3}{c}
{textit{textbf{Service2}}} & multicolumn{3}{c}
{textit{textbf{Service3}}} & multicolumn{3}{c}
{textit{textbf{Service4}}} \ hline
rowcolor[HTML]{EFEFEF}
textit{} & textit{True} & textit{False} & textit{Accuracy} &
textit{True} & textit{False} & textit{Accuracy} & textit{True} &
textit{False} & textit{Accuracy} & textit{True} & textit{False} &
textit{Accuracy} \ hline
textit{#1} & n & n & n% & x & x & x & n & n & n% & n &
n & n% \ hline
rowcolor[HTML]{EFEFEF}
textit{#2} & n & n & n% & x & x & x & n & n & n% & n &
n & n% \ hline
textit{#3} & n & n & n% & x & x & x & n & n & n% & n &
n & n% \ hline
rowcolor[HTML]{EFEFEF}
textit{#4} & n & n & n% & x & x & x & n& 100 & n% & n
& n & n% \ hline
begin{tabular}[c]{@{}l@{}}#5, \ #6, \ #7end{tabular} & n & n &
n% & n & n & n% & n & n & n% & n & n & n% \ hline
end{tabular}%
}
end{table}
tables
Welcome to TeX.SE. It would be helpful if you composed a fully compilable minimal working example (MWE) includingdocumentclass
and the appropriate packages that sets up the problem. While solving problems can be fun, setting them up is not. Then, those trying to help can simply cut and paste your MWE and get started on solving the problem.
– samcarter
Mar 13 at 22:14
add a comment |
I have reviewed quite a few posts on here, yet everything seems to be breaking my table, so I figured I'd just post my probem and ask for help. I generated a table using https://www.tablesgenerator.com
I am having issues fitting my table to the width of the page without shrinking the text:
documentclass[acmsmall]{acmart}
usepackage{graphicx}
usepackage[table,xcdraw]{xcolor}
begin{table}
resizebox{textwidth}{!}{%
begin{tabular}{lcccccccccccc}
hline
rowcolor[HTML]{EFEFEF}
multicolumn{13}{c}{cellcolor[HTML]{EFEFEF}textbf{Title}} \ hline
textit{textbf{Hashtag}} & multicolumn{3}{c}
{textit{textbf{Service1}}} & multicolumn{3}{c}
{textit{textbf{Service2}}} & multicolumn{3}{c}
{textit{textbf{Service3}}} & multicolumn{3}{c}
{textit{textbf{Service4}}} \ hline
rowcolor[HTML]{EFEFEF}
textit{} & textit{True} & textit{False} & textit{Accuracy} &
textit{True} & textit{False} & textit{Accuracy} & textit{True} &
textit{False} & textit{Accuracy} & textit{True} & textit{False} &
textit{Accuracy} \ hline
textit{#1} & n & n & n% & x & x & x & n & n & n% & n &
n & n% \ hline
rowcolor[HTML]{EFEFEF}
textit{#2} & n & n & n% & x & x & x & n & n & n% & n &
n & n% \ hline
textit{#3} & n & n & n% & x & x & x & n & n & n% & n &
n & n% \ hline
rowcolor[HTML]{EFEFEF}
textit{#4} & n & n & n% & x & x & x & n& 100 & n% & n
& n & n% \ hline
begin{tabular}[c]{@{}l@{}}#5, \ #6, \ #7end{tabular} & n & n &
n% & n & n & n% & n & n & n% & n & n & n% \ hline
end{tabular}%
}
end{table}
tables
I have reviewed quite a few posts on here, yet everything seems to be breaking my table, so I figured I'd just post my probem and ask for help. I generated a table using https://www.tablesgenerator.com
I am having issues fitting my table to the width of the page without shrinking the text:
documentclass[acmsmall]{acmart}
usepackage{graphicx}
usepackage[table,xcdraw]{xcolor}
begin{table}
resizebox{textwidth}{!}{%
begin{tabular}{lcccccccccccc}
hline
rowcolor[HTML]{EFEFEF}
multicolumn{13}{c}{cellcolor[HTML]{EFEFEF}textbf{Title}} \ hline
textit{textbf{Hashtag}} & multicolumn{3}{c}
{textit{textbf{Service1}}} & multicolumn{3}{c}
{textit{textbf{Service2}}} & multicolumn{3}{c}
{textit{textbf{Service3}}} & multicolumn{3}{c}
{textit{textbf{Service4}}} \ hline
rowcolor[HTML]{EFEFEF}
textit{} & textit{True} & textit{False} & textit{Accuracy} &
textit{True} & textit{False} & textit{Accuracy} & textit{True} &
textit{False} & textit{Accuracy} & textit{True} & textit{False} &
textit{Accuracy} \ hline
textit{#1} & n & n & n% & x & x & x & n & n & n% & n &
n & n% \ hline
rowcolor[HTML]{EFEFEF}
textit{#2} & n & n & n% & x & x & x & n & n & n% & n &
n & n% \ hline
textit{#3} & n & n & n% & x & x & x & n & n & n% & n &
n & n% \ hline
rowcolor[HTML]{EFEFEF}
textit{#4} & n & n & n% & x & x & x & n& 100 & n% & n
& n & n% \ hline
begin{tabular}[c]{@{}l@{}}#5, \ #6, \ #7end{tabular} & n & n &
n% & n & n & n% & n & n & n% & n & n & n% \ hline
end{tabular}%
}
end{table}
tables
tables
edited Mar 13 at 22:21
cranbarrier
asked Mar 13 at 22:13
cranbarriercranbarrier
62
62
Welcome to TeX.SE. It would be helpful if you composed a fully compilable minimal working example (MWE) includingdocumentclass
and the appropriate packages that sets up the problem. While solving problems can be fun, setting them up is not. Then, those trying to help can simply cut and paste your MWE and get started on solving the problem.
– samcarter
Mar 13 at 22:14
add a comment |
Welcome to TeX.SE. It would be helpful if you composed a fully compilable minimal working example (MWE) includingdocumentclass
and the appropriate packages that sets up the problem. While solving problems can be fun, setting them up is not. Then, those trying to help can simply cut and paste your MWE and get started on solving the problem.
– samcarter
Mar 13 at 22:14
Welcome to TeX.SE. It would be helpful if you composed a fully compilable minimal working example (MWE) including
documentclass
and the appropriate packages that sets up the problem. While solving problems can be fun, setting them up is not. Then, those trying to help can simply cut and paste your MWE and get started on solving the problem.– samcarter
Mar 13 at 22:14
Welcome to TeX.SE. It would be helpful if you composed a fully compilable minimal working example (MWE) including
documentclass
and the appropriate packages that sets up the problem. While solving problems can be fun, setting them up is not. Then, those trying to help can simply cut and paste your MWE and get started on solving the problem.– samcarter
Mar 13 at 22:14
add a comment |
2 Answers
2
active
oldest
votes
Here are two more possible solutions using a smaller tabcolsep
or abbreviated column headers:
documentclass[acmsmall]{acmart}
usepackage{graphicx}
usepackage{colortbl}
begin{document}
begin{table}
setlength{tabcolsep}{4pt}
begin{tabular}{lcccccccccccc}
hline
rowcolor[HTML]{EFEFEF}
multicolumn{13}{c}{cellcolor[HTML]{EFEFEF}textbf{Title}} \ hline
textit{textbf{Hashtag}} & multicolumn{3}{c}
{textit{textbf{Service1}}} & multicolumn{3}{c}
{textit{textbf{Service2}}} & multicolumn{3}{c}
{textit{textbf{Service3}}} & multicolumn{3}{c}
{textit{textbf{Service4}}} \ hline
rowcolor[HTML]{EFEFEF}
textit{} & textit{True} & textit{False} & textit{Acc.} &
textit{True} & textit{False} & textit{Acc.} & textit{True} &
textit{False} & textit{Accuracy} & textit{True} & textit{False} &
textit{Acc.} \ hline
textit{#1} & n & n & n% & x & x & x & n & n & n% & n &
n & n% \ hline
rowcolor[HTML]{EFEFEF}
textit{#2} & n & n & n% & x & x & x & n & n & n% & n &
n & n% \ hline
textit{#3} & n & n & n% & x & x & x & n & n & n% & n &
n & n% \ hline
rowcolor[HTML]{EFEFEF}
textit{#4} & n & n & n% & x & x & x & n& 100 & n% & n
& n & n% \ hline
#5 &&&&&&&&&&&&\
#6, & n & n &
n% & n & n & n% & n & n & n% & n & n & n% \
#7 &&&&&&&&&&&&\
hline
end{tabular}
end{table}
begin{table}
begin{tabular}{lcccccccccccc}
hline
rowcolor[HTML]{EFEFEF}
multicolumn{13}{c}{cellcolor[HTML]{EFEFEF}textbf{Title}} \ hline
textit{textbf{Hashtag}} & multicolumn{3}{c}
{textit{textbf{Service1}}} & multicolumn{3}{c}
{textit{textbf{Service2}}} & multicolumn{3}{c}
{textit{textbf{Service3}}} & multicolumn{3}{c}
{textit{textbf{Service4}}} \ hline
rowcolor[HTML]{EFEFEF}
textit{} & textit{T} & textit{F} & textit{Acc.} &
textit{T} & textit{F} & textit{Acc.} & textit{T} &
textit{F} & textit{Acc.} & textit{T} & textit{F} &
textit{Acc.} \ hline
textit{#1} & n & n & n% & x & x & x & n & n & n% & n &
n & n% \ hline
rowcolor[HTML]{EFEFEF}
textit{#2} & n & n & n% & x & x & x & n & n & n% & n &
n & n% \ hline
textit{#3} & n & n & n% & x & x & x & n & n & n% & n &
n & n% \ hline
rowcolor[HTML]{EFEFEF}
textit{#4} & n & n & n% & x & x & x & n& 100 & n% & n
& n & n% \ hline
begin{tabular}[c]{@{}l@{}}#5, \ #6, \ #7end{tabular} & n & n &
n% & n & n & n% & n & n & n% & n & n & n% \ hline
multicolumn{13}{l}{T: True, F: False, Acc.: Accuracy}
end{tabular}%
end{table}
end{document}
add a comment |
The table has too many columns to fit in the available text width at its normal size, but instead of using resizebox
you could manually select a smaller font size, e.g. small
, this will give you more appropriate letter shapes for the font size.
In addition you could safe some space by abbreviating some of the long words in the header.
PassOptionsToPackage{table,xcdraw}{xcolor}
PassOptionsToPackage{showframe}{geometry}
documentclass[acmsmall]{acmart}
usepackage{graphicx}
% usepackage[table,xcdraw]{xcolor}
begin{document}
begin{table}
% resizebox{textwidth}{!}{%
small
begin{tabular}{lcccccccccccc}
hline
rowcolor[HTML]{EFEFEF}
multicolumn{13}{c}{cellcolor[HTML]{EFEFEF}textbf{Title}} \ hline
textit{textbf{Hashtag}} & multicolumn{3}{c}
{textit{textbf{Service1}}} & multicolumn{3}{c}
{textit{textbf{Service2}}} & multicolumn{3}{c}
{textit{textbf{Service3}}} & multicolumn{3}{c}
{textit{textbf{Service4}}} \ hline
rowcolor[HTML]{EFEFEF}
textit{} & textit{True} & textit{False} & textit{Acc.} &
textit{True} & textit{False} & textit{Acc.} & textit{True} &
textit{False} & textit{Accuracy} & textit{True} & textit{False} &
textit{Acc.} \ hline
textit{#1} & n & n & n% & x & x & x & n & n & n% & n &
n & n% \ hline
rowcolor[HTML]{EFEFEF}
textit{#2} & n & n & n% & x & x & x & n & n & n% & n &
n & n% \ hline
textit{#3} & n & n & n% & x & x & x & n & n & n% & n &
n & n% \ hline
rowcolor[HTML]{EFEFEF}
textit{#4} & n & n & n% & x & x & x & n& 100 & n% & n
& n & n% \ hline
#5 &&&&&&&&&&&&\
#6, & n & n &
n% & n & n & n% & n & n & n% & n & n & n% \
#7 &&&&&&&&&&&&\
hline
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
});
}
});
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%2f479368%2fissues-fitting-generated-table-to-width%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Here are two more possible solutions using a smaller tabcolsep
or abbreviated column headers:
documentclass[acmsmall]{acmart}
usepackage{graphicx}
usepackage{colortbl}
begin{document}
begin{table}
setlength{tabcolsep}{4pt}
begin{tabular}{lcccccccccccc}
hline
rowcolor[HTML]{EFEFEF}
multicolumn{13}{c}{cellcolor[HTML]{EFEFEF}textbf{Title}} \ hline
textit{textbf{Hashtag}} & multicolumn{3}{c}
{textit{textbf{Service1}}} & multicolumn{3}{c}
{textit{textbf{Service2}}} & multicolumn{3}{c}
{textit{textbf{Service3}}} & multicolumn{3}{c}
{textit{textbf{Service4}}} \ hline
rowcolor[HTML]{EFEFEF}
textit{} & textit{True} & textit{False} & textit{Acc.} &
textit{True} & textit{False} & textit{Acc.} & textit{True} &
textit{False} & textit{Accuracy} & textit{True} & textit{False} &
textit{Acc.} \ hline
textit{#1} & n & n & n% & x & x & x & n & n & n% & n &
n & n% \ hline
rowcolor[HTML]{EFEFEF}
textit{#2} & n & n & n% & x & x & x & n & n & n% & n &
n & n% \ hline
textit{#3} & n & n & n% & x & x & x & n & n & n% & n &
n & n% \ hline
rowcolor[HTML]{EFEFEF}
textit{#4} & n & n & n% & x & x & x & n& 100 & n% & n
& n & n% \ hline
#5 &&&&&&&&&&&&\
#6, & n & n &
n% & n & n & n% & n & n & n% & n & n & n% \
#7 &&&&&&&&&&&&\
hline
end{tabular}
end{table}
begin{table}
begin{tabular}{lcccccccccccc}
hline
rowcolor[HTML]{EFEFEF}
multicolumn{13}{c}{cellcolor[HTML]{EFEFEF}textbf{Title}} \ hline
textit{textbf{Hashtag}} & multicolumn{3}{c}
{textit{textbf{Service1}}} & multicolumn{3}{c}
{textit{textbf{Service2}}} & multicolumn{3}{c}
{textit{textbf{Service3}}} & multicolumn{3}{c}
{textit{textbf{Service4}}} \ hline
rowcolor[HTML]{EFEFEF}
textit{} & textit{T} & textit{F} & textit{Acc.} &
textit{T} & textit{F} & textit{Acc.} & textit{T} &
textit{F} & textit{Acc.} & textit{T} & textit{F} &
textit{Acc.} \ hline
textit{#1} & n & n & n% & x & x & x & n & n & n% & n &
n & n% \ hline
rowcolor[HTML]{EFEFEF}
textit{#2} & n & n & n% & x & x & x & n & n & n% & n &
n & n% \ hline
textit{#3} & n & n & n% & x & x & x & n & n & n% & n &
n & n% \ hline
rowcolor[HTML]{EFEFEF}
textit{#4} & n & n & n% & x & x & x & n& 100 & n% & n
& n & n% \ hline
begin{tabular}[c]{@{}l@{}}#5, \ #6, \ #7end{tabular} & n & n &
n% & n & n & n% & n & n & n% & n & n & n% \ hline
multicolumn{13}{l}{T: True, F: False, Acc.: Accuracy}
end{tabular}%
end{table}
end{document}
add a comment |
Here are two more possible solutions using a smaller tabcolsep
or abbreviated column headers:
documentclass[acmsmall]{acmart}
usepackage{graphicx}
usepackage{colortbl}
begin{document}
begin{table}
setlength{tabcolsep}{4pt}
begin{tabular}{lcccccccccccc}
hline
rowcolor[HTML]{EFEFEF}
multicolumn{13}{c}{cellcolor[HTML]{EFEFEF}textbf{Title}} \ hline
textit{textbf{Hashtag}} & multicolumn{3}{c}
{textit{textbf{Service1}}} & multicolumn{3}{c}
{textit{textbf{Service2}}} & multicolumn{3}{c}
{textit{textbf{Service3}}} & multicolumn{3}{c}
{textit{textbf{Service4}}} \ hline
rowcolor[HTML]{EFEFEF}
textit{} & textit{True} & textit{False} & textit{Acc.} &
textit{True} & textit{False} & textit{Acc.} & textit{True} &
textit{False} & textit{Accuracy} & textit{True} & textit{False} &
textit{Acc.} \ hline
textit{#1} & n & n & n% & x & x & x & n & n & n% & n &
n & n% \ hline
rowcolor[HTML]{EFEFEF}
textit{#2} & n & n & n% & x & x & x & n & n & n% & n &
n & n% \ hline
textit{#3} & n & n & n% & x & x & x & n & n & n% & n &
n & n% \ hline
rowcolor[HTML]{EFEFEF}
textit{#4} & n & n & n% & x & x & x & n& 100 & n% & n
& n & n% \ hline
#5 &&&&&&&&&&&&\
#6, & n & n &
n% & n & n & n% & n & n & n% & n & n & n% \
#7 &&&&&&&&&&&&\
hline
end{tabular}
end{table}
begin{table}
begin{tabular}{lcccccccccccc}
hline
rowcolor[HTML]{EFEFEF}
multicolumn{13}{c}{cellcolor[HTML]{EFEFEF}textbf{Title}} \ hline
textit{textbf{Hashtag}} & multicolumn{3}{c}
{textit{textbf{Service1}}} & multicolumn{3}{c}
{textit{textbf{Service2}}} & multicolumn{3}{c}
{textit{textbf{Service3}}} & multicolumn{3}{c}
{textit{textbf{Service4}}} \ hline
rowcolor[HTML]{EFEFEF}
textit{} & textit{T} & textit{F} & textit{Acc.} &
textit{T} & textit{F} & textit{Acc.} & textit{T} &
textit{F} & textit{Acc.} & textit{T} & textit{F} &
textit{Acc.} \ hline
textit{#1} & n & n & n% & x & x & x & n & n & n% & n &
n & n% \ hline
rowcolor[HTML]{EFEFEF}
textit{#2} & n & n & n% & x & x & x & n & n & n% & n &
n & n% \ hline
textit{#3} & n & n & n% & x & x & x & n & n & n% & n &
n & n% \ hline
rowcolor[HTML]{EFEFEF}
textit{#4} & n & n & n% & x & x & x & n& 100 & n% & n
& n & n% \ hline
begin{tabular}[c]{@{}l@{}}#5, \ #6, \ #7end{tabular} & n & n &
n% & n & n & n% & n & n & n% & n & n & n% \ hline
multicolumn{13}{l}{T: True, F: False, Acc.: Accuracy}
end{tabular}%
end{table}
end{document}
add a comment |
Here are two more possible solutions using a smaller tabcolsep
or abbreviated column headers:
documentclass[acmsmall]{acmart}
usepackage{graphicx}
usepackage{colortbl}
begin{document}
begin{table}
setlength{tabcolsep}{4pt}
begin{tabular}{lcccccccccccc}
hline
rowcolor[HTML]{EFEFEF}
multicolumn{13}{c}{cellcolor[HTML]{EFEFEF}textbf{Title}} \ hline
textit{textbf{Hashtag}} & multicolumn{3}{c}
{textit{textbf{Service1}}} & multicolumn{3}{c}
{textit{textbf{Service2}}} & multicolumn{3}{c}
{textit{textbf{Service3}}} & multicolumn{3}{c}
{textit{textbf{Service4}}} \ hline
rowcolor[HTML]{EFEFEF}
textit{} & textit{True} & textit{False} & textit{Acc.} &
textit{True} & textit{False} & textit{Acc.} & textit{True} &
textit{False} & textit{Accuracy} & textit{True} & textit{False} &
textit{Acc.} \ hline
textit{#1} & n & n & n% & x & x & x & n & n & n% & n &
n & n% \ hline
rowcolor[HTML]{EFEFEF}
textit{#2} & n & n & n% & x & x & x & n & n & n% & n &
n & n% \ hline
textit{#3} & n & n & n% & x & x & x & n & n & n% & n &
n & n% \ hline
rowcolor[HTML]{EFEFEF}
textit{#4} & n & n & n% & x & x & x & n& 100 & n% & n
& n & n% \ hline
#5 &&&&&&&&&&&&\
#6, & n & n &
n% & n & n & n% & n & n & n% & n & n & n% \
#7 &&&&&&&&&&&&\
hline
end{tabular}
end{table}
begin{table}
begin{tabular}{lcccccccccccc}
hline
rowcolor[HTML]{EFEFEF}
multicolumn{13}{c}{cellcolor[HTML]{EFEFEF}textbf{Title}} \ hline
textit{textbf{Hashtag}} & multicolumn{3}{c}
{textit{textbf{Service1}}} & multicolumn{3}{c}
{textit{textbf{Service2}}} & multicolumn{3}{c}
{textit{textbf{Service3}}} & multicolumn{3}{c}
{textit{textbf{Service4}}} \ hline
rowcolor[HTML]{EFEFEF}
textit{} & textit{T} & textit{F} & textit{Acc.} &
textit{T} & textit{F} & textit{Acc.} & textit{T} &
textit{F} & textit{Acc.} & textit{T} & textit{F} &
textit{Acc.} \ hline
textit{#1} & n & n & n% & x & x & x & n & n & n% & n &
n & n% \ hline
rowcolor[HTML]{EFEFEF}
textit{#2} & n & n & n% & x & x & x & n & n & n% & n &
n & n% \ hline
textit{#3} & n & n & n% & x & x & x & n & n & n% & n &
n & n% \ hline
rowcolor[HTML]{EFEFEF}
textit{#4} & n & n & n% & x & x & x & n& 100 & n% & n
& n & n% \ hline
begin{tabular}[c]{@{}l@{}}#5, \ #6, \ #7end{tabular} & n & n &
n% & n & n & n% & n & n & n% & n & n & n% \ hline
multicolumn{13}{l}{T: True, F: False, Acc.: Accuracy}
end{tabular}%
end{table}
end{document}
Here are two more possible solutions using a smaller tabcolsep
or abbreviated column headers:
documentclass[acmsmall]{acmart}
usepackage{graphicx}
usepackage{colortbl}
begin{document}
begin{table}
setlength{tabcolsep}{4pt}
begin{tabular}{lcccccccccccc}
hline
rowcolor[HTML]{EFEFEF}
multicolumn{13}{c}{cellcolor[HTML]{EFEFEF}textbf{Title}} \ hline
textit{textbf{Hashtag}} & multicolumn{3}{c}
{textit{textbf{Service1}}} & multicolumn{3}{c}
{textit{textbf{Service2}}} & multicolumn{3}{c}
{textit{textbf{Service3}}} & multicolumn{3}{c}
{textit{textbf{Service4}}} \ hline
rowcolor[HTML]{EFEFEF}
textit{} & textit{True} & textit{False} & textit{Acc.} &
textit{True} & textit{False} & textit{Acc.} & textit{True} &
textit{False} & textit{Accuracy} & textit{True} & textit{False} &
textit{Acc.} \ hline
textit{#1} & n & n & n% & x & x & x & n & n & n% & n &
n & n% \ hline
rowcolor[HTML]{EFEFEF}
textit{#2} & n & n & n% & x & x & x & n & n & n% & n &
n & n% \ hline
textit{#3} & n & n & n% & x & x & x & n & n & n% & n &
n & n% \ hline
rowcolor[HTML]{EFEFEF}
textit{#4} & n & n & n% & x & x & x & n& 100 & n% & n
& n & n% \ hline
#5 &&&&&&&&&&&&\
#6, & n & n &
n% & n & n & n% & n & n & n% & n & n & n% \
#7 &&&&&&&&&&&&\
hline
end{tabular}
end{table}
begin{table}
begin{tabular}{lcccccccccccc}
hline
rowcolor[HTML]{EFEFEF}
multicolumn{13}{c}{cellcolor[HTML]{EFEFEF}textbf{Title}} \ hline
textit{textbf{Hashtag}} & multicolumn{3}{c}
{textit{textbf{Service1}}} & multicolumn{3}{c}
{textit{textbf{Service2}}} & multicolumn{3}{c}
{textit{textbf{Service3}}} & multicolumn{3}{c}
{textit{textbf{Service4}}} \ hline
rowcolor[HTML]{EFEFEF}
textit{} & textit{T} & textit{F} & textit{Acc.} &
textit{T} & textit{F} & textit{Acc.} & textit{T} &
textit{F} & textit{Acc.} & textit{T} & textit{F} &
textit{Acc.} \ hline
textit{#1} & n & n & n% & x & x & x & n & n & n% & n &
n & n% \ hline
rowcolor[HTML]{EFEFEF}
textit{#2} & n & n & n% & x & x & x & n & n & n% & n &
n & n% \ hline
textit{#3} & n & n & n% & x & x & x & n & n & n% & n &
n & n% \ hline
rowcolor[HTML]{EFEFEF}
textit{#4} & n & n & n% & x & x & x & n& 100 & n% & n
& n & n% \ hline
begin{tabular}[c]{@{}l@{}}#5, \ #6, \ #7end{tabular} & n & n &
n% & n & n & n% & n & n & n% & n & n & n% \ hline
multicolumn{13}{l}{T: True, F: False, Acc.: Accuracy}
end{tabular}%
end{table}
end{document}
answered Mar 13 at 22:48
leandriisleandriis
10.5k1732
10.5k1732
add a comment |
add a comment |
The table has too many columns to fit in the available text width at its normal size, but instead of using resizebox
you could manually select a smaller font size, e.g. small
, this will give you more appropriate letter shapes for the font size.
In addition you could safe some space by abbreviating some of the long words in the header.
PassOptionsToPackage{table,xcdraw}{xcolor}
PassOptionsToPackage{showframe}{geometry}
documentclass[acmsmall]{acmart}
usepackage{graphicx}
% usepackage[table,xcdraw]{xcolor}
begin{document}
begin{table}
% resizebox{textwidth}{!}{%
small
begin{tabular}{lcccccccccccc}
hline
rowcolor[HTML]{EFEFEF}
multicolumn{13}{c}{cellcolor[HTML]{EFEFEF}textbf{Title}} \ hline
textit{textbf{Hashtag}} & multicolumn{3}{c}
{textit{textbf{Service1}}} & multicolumn{3}{c}
{textit{textbf{Service2}}} & multicolumn{3}{c}
{textit{textbf{Service3}}} & multicolumn{3}{c}
{textit{textbf{Service4}}} \ hline
rowcolor[HTML]{EFEFEF}
textit{} & textit{True} & textit{False} & textit{Acc.} &
textit{True} & textit{False} & textit{Acc.} & textit{True} &
textit{False} & textit{Accuracy} & textit{True} & textit{False} &
textit{Acc.} \ hline
textit{#1} & n & n & n% & x & x & x & n & n & n% & n &
n & n% \ hline
rowcolor[HTML]{EFEFEF}
textit{#2} & n & n & n% & x & x & x & n & n & n% & n &
n & n% \ hline
textit{#3} & n & n & n% & x & x & x & n & n & n% & n &
n & n% \ hline
rowcolor[HTML]{EFEFEF}
textit{#4} & n & n & n% & x & x & x & n& 100 & n% & n
& n & n% \ hline
#5 &&&&&&&&&&&&\
#6, & n & n &
n% & n & n & n% & n & n & n% & n & n & n% \
#7 &&&&&&&&&&&&\
hline
end{tabular}%
% }
end{table}
end{document}
add a comment |
The table has too many columns to fit in the available text width at its normal size, but instead of using resizebox
you could manually select a smaller font size, e.g. small
, this will give you more appropriate letter shapes for the font size.
In addition you could safe some space by abbreviating some of the long words in the header.
PassOptionsToPackage{table,xcdraw}{xcolor}
PassOptionsToPackage{showframe}{geometry}
documentclass[acmsmall]{acmart}
usepackage{graphicx}
% usepackage[table,xcdraw]{xcolor}
begin{document}
begin{table}
% resizebox{textwidth}{!}{%
small
begin{tabular}{lcccccccccccc}
hline
rowcolor[HTML]{EFEFEF}
multicolumn{13}{c}{cellcolor[HTML]{EFEFEF}textbf{Title}} \ hline
textit{textbf{Hashtag}} & multicolumn{3}{c}
{textit{textbf{Service1}}} & multicolumn{3}{c}
{textit{textbf{Service2}}} & multicolumn{3}{c}
{textit{textbf{Service3}}} & multicolumn{3}{c}
{textit{textbf{Service4}}} \ hline
rowcolor[HTML]{EFEFEF}
textit{} & textit{True} & textit{False} & textit{Acc.} &
textit{True} & textit{False} & textit{Acc.} & textit{True} &
textit{False} & textit{Accuracy} & textit{True} & textit{False} &
textit{Acc.} \ hline
textit{#1} & n & n & n% & x & x & x & n & n & n% & n &
n & n% \ hline
rowcolor[HTML]{EFEFEF}
textit{#2} & n & n & n% & x & x & x & n & n & n% & n &
n & n% \ hline
textit{#3} & n & n & n% & x & x & x & n & n & n% & n &
n & n% \ hline
rowcolor[HTML]{EFEFEF}
textit{#4} & n & n & n% & x & x & x & n& 100 & n% & n
& n & n% \ hline
#5 &&&&&&&&&&&&\
#6, & n & n &
n% & n & n & n% & n & n & n% & n & n & n% \
#7 &&&&&&&&&&&&\
hline
end{tabular}%
% }
end{table}
end{document}
add a comment |
The table has too many columns to fit in the available text width at its normal size, but instead of using resizebox
you could manually select a smaller font size, e.g. small
, this will give you more appropriate letter shapes for the font size.
In addition you could safe some space by abbreviating some of the long words in the header.
PassOptionsToPackage{table,xcdraw}{xcolor}
PassOptionsToPackage{showframe}{geometry}
documentclass[acmsmall]{acmart}
usepackage{graphicx}
% usepackage[table,xcdraw]{xcolor}
begin{document}
begin{table}
% resizebox{textwidth}{!}{%
small
begin{tabular}{lcccccccccccc}
hline
rowcolor[HTML]{EFEFEF}
multicolumn{13}{c}{cellcolor[HTML]{EFEFEF}textbf{Title}} \ hline
textit{textbf{Hashtag}} & multicolumn{3}{c}
{textit{textbf{Service1}}} & multicolumn{3}{c}
{textit{textbf{Service2}}} & multicolumn{3}{c}
{textit{textbf{Service3}}} & multicolumn{3}{c}
{textit{textbf{Service4}}} \ hline
rowcolor[HTML]{EFEFEF}
textit{} & textit{True} & textit{False} & textit{Acc.} &
textit{True} & textit{False} & textit{Acc.} & textit{True} &
textit{False} & textit{Accuracy} & textit{True} & textit{False} &
textit{Acc.} \ hline
textit{#1} & n & n & n% & x & x & x & n & n & n% & n &
n & n% \ hline
rowcolor[HTML]{EFEFEF}
textit{#2} & n & n & n% & x & x & x & n & n & n% & n &
n & n% \ hline
textit{#3} & n & n & n% & x & x & x & n & n & n% & n &
n & n% \ hline
rowcolor[HTML]{EFEFEF}
textit{#4} & n & n & n% & x & x & x & n& 100 & n% & n
& n & n% \ hline
#5 &&&&&&&&&&&&\
#6, & n & n &
n% & n & n & n% & n & n & n% & n & n & n% \
#7 &&&&&&&&&&&&\
hline
end{tabular}%
% }
end{table}
end{document}
The table has too many columns to fit in the available text width at its normal size, but instead of using resizebox
you could manually select a smaller font size, e.g. small
, this will give you more appropriate letter shapes for the font size.
In addition you could safe some space by abbreviating some of the long words in the header.
PassOptionsToPackage{table,xcdraw}{xcolor}
PassOptionsToPackage{showframe}{geometry}
documentclass[acmsmall]{acmart}
usepackage{graphicx}
% usepackage[table,xcdraw]{xcolor}
begin{document}
begin{table}
% resizebox{textwidth}{!}{%
small
begin{tabular}{lcccccccccccc}
hline
rowcolor[HTML]{EFEFEF}
multicolumn{13}{c}{cellcolor[HTML]{EFEFEF}textbf{Title}} \ hline
textit{textbf{Hashtag}} & multicolumn{3}{c}
{textit{textbf{Service1}}} & multicolumn{3}{c}
{textit{textbf{Service2}}} & multicolumn{3}{c}
{textit{textbf{Service3}}} & multicolumn{3}{c}
{textit{textbf{Service4}}} \ hline
rowcolor[HTML]{EFEFEF}
textit{} & textit{True} & textit{False} & textit{Acc.} &
textit{True} & textit{False} & textit{Acc.} & textit{True} &
textit{False} & textit{Accuracy} & textit{True} & textit{False} &
textit{Acc.} \ hline
textit{#1} & n & n & n% & x & x & x & n & n & n% & n &
n & n% \ hline
rowcolor[HTML]{EFEFEF}
textit{#2} & n & n & n% & x & x & x & n & n & n% & n &
n & n% \ hline
textit{#3} & n & n & n% & x & x & x & n & n & n% & n &
n & n% \ hline
rowcolor[HTML]{EFEFEF}
textit{#4} & n & n & n% & x & x & x & n& 100 & n% & n
& n & n% \ hline
#5 &&&&&&&&&&&&\
#6, & n & n &
n% & n & n & n% & n & n & n% & n & n & n% \
#7 &&&&&&&&&&&&\
hline
end{tabular}%
% }
end{table}
end{document}
answered Mar 13 at 22:42
samcartersamcarter
92.6k7105299
92.6k7105299
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%2f479368%2fissues-fitting-generated-table-to-width%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
Welcome to TeX.SE. It would be helpful if you composed a fully compilable minimal working example (MWE) including
documentclass
and the appropriate packages that sets up the problem. While solving problems can be fun, setting them up is not. Then, those trying to help can simply cut and paste your MWE and get started on solving the problem.– samcarter
Mar 13 at 22:14