adapt columns in multicolumn
up vote
2
down vote
favorite
I would like to change the first column into three columns, such that I can write three numbers in each row instead of only one. Everything else should stay the same.
documentclass{article}
usepackage{tabularx}
usepackage{caption}
usepackage{showframe}
newcommand{thead}[1]{begin{tabular}[t]{c}#1end{tabular}}
begin{document}
begin{table}
centering
renewcommand{tabularxcolumn}[1]{>{centeringarraybackslash}p{#1}}
begin{tabularx}{textwidth}{|c|*4{X|}}
hline
& multicolumn{2}{c|}{thead{here a longer text is written}}
& multicolumn{2}{c|}{thead{here also a longer text is written}} \
cline{2-5}
thead{A\number} & left & right & left & right \
hline
1 & X & X & X & X\
2 & X & X & X & X\
3 & X & X & X & X\
4 & X & X & X & X\
hline
end{tabularx}
end{table}
end{document}
tables tabularx multicolumn
New contributor
add a comment |
up vote
2
down vote
favorite
I would like to change the first column into three columns, such that I can write three numbers in each row instead of only one. Everything else should stay the same.
documentclass{article}
usepackage{tabularx}
usepackage{caption}
usepackage{showframe}
newcommand{thead}[1]{begin{tabular}[t]{c}#1end{tabular}}
begin{document}
begin{table}
centering
renewcommand{tabularxcolumn}[1]{>{centeringarraybackslash}p{#1}}
begin{tabularx}{textwidth}{|c|*4{X|}}
hline
& multicolumn{2}{c|}{thead{here a longer text is written}}
& multicolumn{2}{c|}{thead{here also a longer text is written}} \
cline{2-5}
thead{A\number} & left & right & left & right \
hline
1 & X & X & X & X\
2 & X & X & X & X\
3 & X & X & X & X\
4 & X & X & X & X\
hline
end{tabularx}
end{table}
end{document}
tables tabularx multicolumn
New contributor
1
Three numbers stacked? If so, what should the alignment be with respect to the otherX
-columns? If they should be horizontally spread instead, do you require alignment across the rows? Do you have any restrictions/requirements in terms of the input? Perhaps you can provide an image of the expected output you're after.
– Werner
Nov 15 at 19:21
add a comment |
up vote
2
down vote
favorite
up vote
2
down vote
favorite
I would like to change the first column into three columns, such that I can write three numbers in each row instead of only one. Everything else should stay the same.
documentclass{article}
usepackage{tabularx}
usepackage{caption}
usepackage{showframe}
newcommand{thead}[1]{begin{tabular}[t]{c}#1end{tabular}}
begin{document}
begin{table}
centering
renewcommand{tabularxcolumn}[1]{>{centeringarraybackslash}p{#1}}
begin{tabularx}{textwidth}{|c|*4{X|}}
hline
& multicolumn{2}{c|}{thead{here a longer text is written}}
& multicolumn{2}{c|}{thead{here also a longer text is written}} \
cline{2-5}
thead{A\number} & left & right & left & right \
hline
1 & X & X & X & X\
2 & X & X & X & X\
3 & X & X & X & X\
4 & X & X & X & X\
hline
end{tabularx}
end{table}
end{document}
tables tabularx multicolumn
New contributor
I would like to change the first column into three columns, such that I can write three numbers in each row instead of only one. Everything else should stay the same.
documentclass{article}
usepackage{tabularx}
usepackage{caption}
usepackage{showframe}
newcommand{thead}[1]{begin{tabular}[t]{c}#1end{tabular}}
begin{document}
begin{table}
centering
renewcommand{tabularxcolumn}[1]{>{centeringarraybackslash}p{#1}}
begin{tabularx}{textwidth}{|c|*4{X|}}
hline
& multicolumn{2}{c|}{thead{here a longer text is written}}
& multicolumn{2}{c|}{thead{here also a longer text is written}} \
cline{2-5}
thead{A\number} & left & right & left & right \
hline
1 & X & X & X & X\
2 & X & X & X & X\
3 & X & X & X & X\
4 & X & X & X & X\
hline
end{tabularx}
end{table}
end{document}
tables tabularx multicolumn
tables tabularx multicolumn
New contributor
New contributor
New contributor
asked Nov 15 at 18:15
user4309
132
132
New contributor
New contributor
1
Three numbers stacked? If so, what should the alignment be with respect to the otherX
-columns? If they should be horizontally spread instead, do you require alignment across the rows? Do you have any restrictions/requirements in terms of the input? Perhaps you can provide an image of the expected output you're after.
– Werner
Nov 15 at 19:21
add a comment |
1
Three numbers stacked? If so, what should the alignment be with respect to the otherX
-columns? If they should be horizontally spread instead, do you require alignment across the rows? Do you have any restrictions/requirements in terms of the input? Perhaps you can provide an image of the expected output you're after.
– Werner
Nov 15 at 19:21
1
1
Three numbers stacked? If so, what should the alignment be with respect to the other
X
-columns? If they should be horizontally spread instead, do you require alignment across the rows? Do you have any restrictions/requirements in terms of the input? Perhaps you can provide an image of the expected output you're after.– Werner
Nov 15 at 19:21
Three numbers stacked? If so, what should the alignment be with respect to the other
X
-columns? If they should be horizontally spread instead, do you require alignment across the rows? Do you have any restrictions/requirements in terms of the input? Perhaps you can provide an image of the expected output you're after.– Werner
Nov 15 at 19:21
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
documentclass{article}
usepackage{tabularx}
usepackage{caption}
usepackage{showframe}
newcommand{thead}[1]{begin{tabular}[t]{c}#1end{tabular}}
begin{document}
begin{table}
centering
renewcommand{tabularxcolumn}[1]{>{centeringarraybackslash}p{#1}}
begin{tabularx}{textwidth}{|*{3}{c|}*{4}{X|}}
hline
multicolumn{3}{|c|}{}
&multicolumn{2}{c|}{thead{here a longer text\ is written}}
& multicolumn{2}{c|}{thead{here also a longer\ text is written}}
\
cline{4-7}
multicolumn{3}{|c|}{thead{3\numbers}} &
left & right & left & right \
hline
1&11&21 & X & X & X & X\
2&12&22 & X & X & X & X\
3&13&23 & X & X & X & X\
4&14&24 & X & X & X & X\
hline
end{tabularx}
end{table}
end{document}
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
documentclass{article}
usepackage{tabularx}
usepackage{caption}
usepackage{showframe}
newcommand{thead}[1]{begin{tabular}[t]{c}#1end{tabular}}
begin{document}
begin{table}
centering
renewcommand{tabularxcolumn}[1]{>{centeringarraybackslash}p{#1}}
begin{tabularx}{textwidth}{|*{3}{c|}*{4}{X|}}
hline
multicolumn{3}{|c|}{}
&multicolumn{2}{c|}{thead{here a longer text\ is written}}
& multicolumn{2}{c|}{thead{here also a longer\ text is written}}
\
cline{4-7}
multicolumn{3}{|c|}{thead{3\numbers}} &
left & right & left & right \
hline
1&11&21 & X & X & X & X\
2&12&22 & X & X & X & X\
3&13&23 & X & X & X & X\
4&14&24 & X & X & X & X\
hline
end{tabularx}
end{table}
end{document}
add a comment |
up vote
1
down vote
accepted
documentclass{article}
usepackage{tabularx}
usepackage{caption}
usepackage{showframe}
newcommand{thead}[1]{begin{tabular}[t]{c}#1end{tabular}}
begin{document}
begin{table}
centering
renewcommand{tabularxcolumn}[1]{>{centeringarraybackslash}p{#1}}
begin{tabularx}{textwidth}{|*{3}{c|}*{4}{X|}}
hline
multicolumn{3}{|c|}{}
&multicolumn{2}{c|}{thead{here a longer text\ is written}}
& multicolumn{2}{c|}{thead{here also a longer\ text is written}}
\
cline{4-7}
multicolumn{3}{|c|}{thead{3\numbers}} &
left & right & left & right \
hline
1&11&21 & X & X & X & X\
2&12&22 & X & X & X & X\
3&13&23 & X & X & X & X\
4&14&24 & X & X & X & X\
hline
end{tabularx}
end{table}
end{document}
add a comment |
up vote
1
down vote
accepted
up vote
1
down vote
accepted
documentclass{article}
usepackage{tabularx}
usepackage{caption}
usepackage{showframe}
newcommand{thead}[1]{begin{tabular}[t]{c}#1end{tabular}}
begin{document}
begin{table}
centering
renewcommand{tabularxcolumn}[1]{>{centeringarraybackslash}p{#1}}
begin{tabularx}{textwidth}{|*{3}{c|}*{4}{X|}}
hline
multicolumn{3}{|c|}{}
&multicolumn{2}{c|}{thead{here a longer text\ is written}}
& multicolumn{2}{c|}{thead{here also a longer\ text is written}}
\
cline{4-7}
multicolumn{3}{|c|}{thead{3\numbers}} &
left & right & left & right \
hline
1&11&21 & X & X & X & X\
2&12&22 & X & X & X & X\
3&13&23 & X & X & X & X\
4&14&24 & X & X & X & X\
hline
end{tabularx}
end{table}
end{document}
documentclass{article}
usepackage{tabularx}
usepackage{caption}
usepackage{showframe}
newcommand{thead}[1]{begin{tabular}[t]{c}#1end{tabular}}
begin{document}
begin{table}
centering
renewcommand{tabularxcolumn}[1]{>{centeringarraybackslash}p{#1}}
begin{tabularx}{textwidth}{|*{3}{c|}*{4}{X|}}
hline
multicolumn{3}{|c|}{}
&multicolumn{2}{c|}{thead{here a longer text\ is written}}
& multicolumn{2}{c|}{thead{here also a longer\ text is written}}
\
cline{4-7}
multicolumn{3}{|c|}{thead{3\numbers}} &
left & right & left & right \
hline
1&11&21 & X & X & X & X\
2&12&22 & X & X & X & X\
3&13&23 & X & X & X & X\
4&14&24 & X & X & X & X\
hline
end{tabularx}
end{table}
end{document}
answered Nov 15 at 20:44
David Carlisle
477k3811061841
477k3811061841
add a comment |
add a comment |
user4309 is a new contributor. Be nice, and check out our Code of Conduct.
user4309 is a new contributor. Be nice, and check out our Code of Conduct.
user4309 is a new contributor. Be nice, and check out our Code of Conduct.
user4309 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%2f460180%2fadapt-columns-in-multicolumn%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
Three numbers stacked? If so, what should the alignment be with respect to the other
X
-columns? If they should be horizontally spread instead, do you require alignment across the rows? Do you have any restrictions/requirements in terms of the input? Perhaps you can provide an image of the expected output you're after.– Werner
Nov 15 at 19:21