Tabularx environment
I have problems translating this table (from Online table generator) to tabularx
environment so it would be coherent with the rest of Tables of my document. Could you kindly help me? Thanks!
documentclass{article}
usepackage{multirow}
usepackage{graphicx}
begin{document}
begin{table}
centering
caption{My caption}
resizebox{textwidth}{!}{%
begin{tabular}{cccccc}
hline
1 & 2 & 3 & 4 & 5 & 6 \
hline
multirow{2}{*}{Pepe} & multirow{2}{*}{a} & multirow{2}{*}{b} & multirow{2}{*}{c} & multirow{2}{*}{d} & e \
& & & & & f \
hline
multicolumn{1}{l}{} & multicolumn{1}{l}{} & multicolumn{1}{l}{} & multicolumn{1}{l}{} & multicolumn{1}{l}{} & multicolumn{1}{l}{} \
hline
end{tabular}%
}
end{table}
end{document}
That is, the table should start by:
documentclass{article}
usepackage{multirow}
usepackage{graphicx}
usepackage{tabularx}
begin{document}
begin{table}
begin{tabularx}{textwidth}
end{tabularx}
BLA, BLA, BLA.
end{table}
end{document}
tables tabularx
add a comment |
I have problems translating this table (from Online table generator) to tabularx
environment so it would be coherent with the rest of Tables of my document. Could you kindly help me? Thanks!
documentclass{article}
usepackage{multirow}
usepackage{graphicx}
begin{document}
begin{table}
centering
caption{My caption}
resizebox{textwidth}{!}{%
begin{tabular}{cccccc}
hline
1 & 2 & 3 & 4 & 5 & 6 \
hline
multirow{2}{*}{Pepe} & multirow{2}{*}{a} & multirow{2}{*}{b} & multirow{2}{*}{c} & multirow{2}{*}{d} & e \
& & & & & f \
hline
multicolumn{1}{l}{} & multicolumn{1}{l}{} & multicolumn{1}{l}{} & multicolumn{1}{l}{} & multicolumn{1}{l}{} & multicolumn{1}{l}{} \
hline
end{tabular}%
}
end{table}
end{document}
That is, the table should start by:
documentclass{article}
usepackage{multirow}
usepackage{graphicx}
usepackage{tabularx}
begin{document}
begin{table}
begin{tabularx}{textwidth}
end{tabularx}
BLA, BLA, BLA.
end{table}
end{document}
tables tabularx
A tip: If you indent lines by 4 spaces or enclose words in backticks`
, they'll be marked as code, as can be seen in my edit. You can also highlight the code and click the "code" button (with "{}" on it).
– Tiuri
yesterday
Remember, tabularx takes two arguments, you only listed one
– daleif
yesterday
1
Centering a box oftextwidth
? Resize a a small table ? Multicolumns of 1 column? Another suggestion: Do no use table generators, the resulting code is garbage.
– Fran
yesterday
add a comment |
I have problems translating this table (from Online table generator) to tabularx
environment so it would be coherent with the rest of Tables of my document. Could you kindly help me? Thanks!
documentclass{article}
usepackage{multirow}
usepackage{graphicx}
begin{document}
begin{table}
centering
caption{My caption}
resizebox{textwidth}{!}{%
begin{tabular}{cccccc}
hline
1 & 2 & 3 & 4 & 5 & 6 \
hline
multirow{2}{*}{Pepe} & multirow{2}{*}{a} & multirow{2}{*}{b} & multirow{2}{*}{c} & multirow{2}{*}{d} & e \
& & & & & f \
hline
multicolumn{1}{l}{} & multicolumn{1}{l}{} & multicolumn{1}{l}{} & multicolumn{1}{l}{} & multicolumn{1}{l}{} & multicolumn{1}{l}{} \
hline
end{tabular}%
}
end{table}
end{document}
That is, the table should start by:
documentclass{article}
usepackage{multirow}
usepackage{graphicx}
usepackage{tabularx}
begin{document}
begin{table}
begin{tabularx}{textwidth}
end{tabularx}
BLA, BLA, BLA.
end{table}
end{document}
tables tabularx
I have problems translating this table (from Online table generator) to tabularx
environment so it would be coherent with the rest of Tables of my document. Could you kindly help me? Thanks!
documentclass{article}
usepackage{multirow}
usepackage{graphicx}
begin{document}
begin{table}
centering
caption{My caption}
resizebox{textwidth}{!}{%
begin{tabular}{cccccc}
hline
1 & 2 & 3 & 4 & 5 & 6 \
hline
multirow{2}{*}{Pepe} & multirow{2}{*}{a} & multirow{2}{*}{b} & multirow{2}{*}{c} & multirow{2}{*}{d} & e \
& & & & & f \
hline
multicolumn{1}{l}{} & multicolumn{1}{l}{} & multicolumn{1}{l}{} & multicolumn{1}{l}{} & multicolumn{1}{l}{} & multicolumn{1}{l}{} \
hline
end{tabular}%
}
end{table}
end{document}
That is, the table should start by:
documentclass{article}
usepackage{multirow}
usepackage{graphicx}
usepackage{tabularx}
begin{document}
begin{table}
begin{tabularx}{textwidth}
end{tabularx}
BLA, BLA, BLA.
end{table}
end{document}
tables tabularx
tables tabularx
edited yesterday
peterdelarue
335
335
asked yesterday
SantiSanti
232
232
A tip: If you indent lines by 4 spaces or enclose words in backticks`
, they'll be marked as code, as can be seen in my edit. You can also highlight the code and click the "code" button (with "{}" on it).
– Tiuri
yesterday
Remember, tabularx takes two arguments, you only listed one
– daleif
yesterday
1
Centering a box oftextwidth
? Resize a a small table ? Multicolumns of 1 column? Another suggestion: Do no use table generators, the resulting code is garbage.
– Fran
yesterday
add a comment |
A tip: If you indent lines by 4 spaces or enclose words in backticks`
, they'll be marked as code, as can be seen in my edit. You can also highlight the code and click the "code" button (with "{}" on it).
– Tiuri
yesterday
Remember, tabularx takes two arguments, you only listed one
– daleif
yesterday
1
Centering a box oftextwidth
? Resize a a small table ? Multicolumns of 1 column? Another suggestion: Do no use table generators, the resulting code is garbage.
– Fran
yesterday
A tip: If you indent lines by 4 spaces or enclose words in backticks
`
, they'll be marked as code, as can be seen in my edit. You can also highlight the code and click the "code" button (with "{}" on it).– Tiuri
yesterday
A tip: If you indent lines by 4 spaces or enclose words in backticks
`
, they'll be marked as code, as can be seen in my edit. You can also highlight the code and click the "code" button (with "{}" on it).– Tiuri
yesterday
Remember, tabularx takes two arguments, you only listed one
– daleif
yesterday
Remember, tabularx takes two arguments, you only listed one
– daleif
yesterday
1
1
Centering a box of
textwidth
? Resize a a small table ? Multicolumns of 1 column? Another suggestion: Do no use table generators, the resulting code is garbage.– Fran
yesterday
Centering a box of
textwidth
? Resize a a small table ? Multicolumns of 1 column? Another suggestion: Do no use table generators, the resulting code is garbage.– Fran
yesterday
add a comment |
3 Answers
3
active
oldest
votes
Here are two solutions. The first uses a tabularx
environment, with all six columns using a centered version of the X column type. The second uses a tabular*
environment, with all six columns using the c
column type. Both solutions occupy the full width of the textblock.
Since multicolumn{1}{l}{}
does nothing at all, you might as well omit those instructions.
documentclass{article}
usepackage{multirow,tabularx,booktabs}
newcommand{mr}[1]{multirow{2}{*}{#1}} % handy shortcut macro
% centered version of X column type:
newcolumntype{C}{>{centeringarraybackslash}X}
usepackage[skip=0.333baselineskip]{caption} % optional
begin{document}
begin{table}
%%centering % <-- redundant
caption{tabularx}
begin{tabularx}{textwidth}{@{} *{6}{C} @{}}
toprule
1 & 2 & 3 & 4 & 5 & 6 \
midrule
mr{Pepe} & mr{a} & mr{b} & mr{c} & mr{d} & e \
& & & & & f \
midrule
& & & & & \ % no need for "multicolumn{1}{l}{}" stuff
bottomrule
end{tabularx}
vspace{1cm} %
setlengthtabcolsep{0pt}
caption{tabular*}
begin{tabular*}{textwidth}{@{extracolsep{fill}} *{6}{c} }
toprule
1 & 2 & 3 & 4 & 5 & 6 \
midrule
mr{Pepe} & mr{a} & mr{b} & mr{c} & mr{d} & e \
& & & & & f \
midrule
& & & & & \ % no need for "multicolumn{1}{l}{}" stuff
bottomrule
end{tabular*}
end{table}
end{document}
add a comment |
As @daleif mentioned you forgot to add the second bracket with your columns' specification {cccccc}
.
I give you a MWE:
documentclass{article}
usepackage{tabularx}
begin{document}
begin{table}
caption{BLA, BLA, BLA.}
centering
begin{tabularx}{.3textwidth}{c}
hlinehline
My table header\
hline
My table contents\
hlinehline
end{tabularx}
end{table}
end{document}
Supplement
Additionally, keep in mind that there is a package called tabu, which is more powerful than tabularx.
New contributor
3
It does not make any sense to use tabularx with no X columns, then you could just as well have used tabular
– daleif
yesterday
I agree with you, the package aim is to adapt the space between columns, e.g.begin{tabularx}{250pt}{|c|X|c|X|}...
– peterdelarue
yesterday
Your MWE, which contains atabularx
column with a single column of typec
, does not really solved the OP's question, which was about a table with six [6] columns. Please consider editing your LaTeX code so that it more directly addresses the OP's needs.
– Mico
yesterday
add a comment |
You do not need multicolumns in every cell, nor multirow{2}{*}{...}
, nor tabularx
or tabular*
to extend the text width, nor empty rows. Here you have enough with m
columns (of array package) and, of course, with booktabs
: :)
documentclass{article}
usepackage{graphicx,array,booktabs}
begin{document}
begin{table}
caption{My caption}
newcolumntype{C}{>{centeringarraybackslash}m{dimexprlinewidth/6-2tabcolsep}}
begin{tabular}{CCCCCC}toprule
1 & 2 & 3 & 4 & 5 & 6 \midrule
Pepe & a & b & c & d &epar f\bottomrule
end{tabular}
end{table}
end{document}
By the way, I would not use columns of more two-three em
here. Widening the table as much as possible instead of a small centered table does not make it more beautiful, but ugly scattered.
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%2f472188%2ftabularx-environment%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 are two solutions. The first uses a tabularx
environment, with all six columns using a centered version of the X column type. The second uses a tabular*
environment, with all six columns using the c
column type. Both solutions occupy the full width of the textblock.
Since multicolumn{1}{l}{}
does nothing at all, you might as well omit those instructions.
documentclass{article}
usepackage{multirow,tabularx,booktabs}
newcommand{mr}[1]{multirow{2}{*}{#1}} % handy shortcut macro
% centered version of X column type:
newcolumntype{C}{>{centeringarraybackslash}X}
usepackage[skip=0.333baselineskip]{caption} % optional
begin{document}
begin{table}
%%centering % <-- redundant
caption{tabularx}
begin{tabularx}{textwidth}{@{} *{6}{C} @{}}
toprule
1 & 2 & 3 & 4 & 5 & 6 \
midrule
mr{Pepe} & mr{a} & mr{b} & mr{c} & mr{d} & e \
& & & & & f \
midrule
& & & & & \ % no need for "multicolumn{1}{l}{}" stuff
bottomrule
end{tabularx}
vspace{1cm} %
setlengthtabcolsep{0pt}
caption{tabular*}
begin{tabular*}{textwidth}{@{extracolsep{fill}} *{6}{c} }
toprule
1 & 2 & 3 & 4 & 5 & 6 \
midrule
mr{Pepe} & mr{a} & mr{b} & mr{c} & mr{d} & e \
& & & & & f \
midrule
& & & & & \ % no need for "multicolumn{1}{l}{}" stuff
bottomrule
end{tabular*}
end{table}
end{document}
add a comment |
Here are two solutions. The first uses a tabularx
environment, with all six columns using a centered version of the X column type. The second uses a tabular*
environment, with all six columns using the c
column type. Both solutions occupy the full width of the textblock.
Since multicolumn{1}{l}{}
does nothing at all, you might as well omit those instructions.
documentclass{article}
usepackage{multirow,tabularx,booktabs}
newcommand{mr}[1]{multirow{2}{*}{#1}} % handy shortcut macro
% centered version of X column type:
newcolumntype{C}{>{centeringarraybackslash}X}
usepackage[skip=0.333baselineskip]{caption} % optional
begin{document}
begin{table}
%%centering % <-- redundant
caption{tabularx}
begin{tabularx}{textwidth}{@{} *{6}{C} @{}}
toprule
1 & 2 & 3 & 4 & 5 & 6 \
midrule
mr{Pepe} & mr{a} & mr{b} & mr{c} & mr{d} & e \
& & & & & f \
midrule
& & & & & \ % no need for "multicolumn{1}{l}{}" stuff
bottomrule
end{tabularx}
vspace{1cm} %
setlengthtabcolsep{0pt}
caption{tabular*}
begin{tabular*}{textwidth}{@{extracolsep{fill}} *{6}{c} }
toprule
1 & 2 & 3 & 4 & 5 & 6 \
midrule
mr{Pepe} & mr{a} & mr{b} & mr{c} & mr{d} & e \
& & & & & f \
midrule
& & & & & \ % no need for "multicolumn{1}{l}{}" stuff
bottomrule
end{tabular*}
end{table}
end{document}
add a comment |
Here are two solutions. The first uses a tabularx
environment, with all six columns using a centered version of the X column type. The second uses a tabular*
environment, with all six columns using the c
column type. Both solutions occupy the full width of the textblock.
Since multicolumn{1}{l}{}
does nothing at all, you might as well omit those instructions.
documentclass{article}
usepackage{multirow,tabularx,booktabs}
newcommand{mr}[1]{multirow{2}{*}{#1}} % handy shortcut macro
% centered version of X column type:
newcolumntype{C}{>{centeringarraybackslash}X}
usepackage[skip=0.333baselineskip]{caption} % optional
begin{document}
begin{table}
%%centering % <-- redundant
caption{tabularx}
begin{tabularx}{textwidth}{@{} *{6}{C} @{}}
toprule
1 & 2 & 3 & 4 & 5 & 6 \
midrule
mr{Pepe} & mr{a} & mr{b} & mr{c} & mr{d} & e \
& & & & & f \
midrule
& & & & & \ % no need for "multicolumn{1}{l}{}" stuff
bottomrule
end{tabularx}
vspace{1cm} %
setlengthtabcolsep{0pt}
caption{tabular*}
begin{tabular*}{textwidth}{@{extracolsep{fill}} *{6}{c} }
toprule
1 & 2 & 3 & 4 & 5 & 6 \
midrule
mr{Pepe} & mr{a} & mr{b} & mr{c} & mr{d} & e \
& & & & & f \
midrule
& & & & & \ % no need for "multicolumn{1}{l}{}" stuff
bottomrule
end{tabular*}
end{table}
end{document}
Here are two solutions. The first uses a tabularx
environment, with all six columns using a centered version of the X column type. The second uses a tabular*
environment, with all six columns using the c
column type. Both solutions occupy the full width of the textblock.
Since multicolumn{1}{l}{}
does nothing at all, you might as well omit those instructions.
documentclass{article}
usepackage{multirow,tabularx,booktabs}
newcommand{mr}[1]{multirow{2}{*}{#1}} % handy shortcut macro
% centered version of X column type:
newcolumntype{C}{>{centeringarraybackslash}X}
usepackage[skip=0.333baselineskip]{caption} % optional
begin{document}
begin{table}
%%centering % <-- redundant
caption{tabularx}
begin{tabularx}{textwidth}{@{} *{6}{C} @{}}
toprule
1 & 2 & 3 & 4 & 5 & 6 \
midrule
mr{Pepe} & mr{a} & mr{b} & mr{c} & mr{d} & e \
& & & & & f \
midrule
& & & & & \ % no need for "multicolumn{1}{l}{}" stuff
bottomrule
end{tabularx}
vspace{1cm} %
setlengthtabcolsep{0pt}
caption{tabular*}
begin{tabular*}{textwidth}{@{extracolsep{fill}} *{6}{c} }
toprule
1 & 2 & 3 & 4 & 5 & 6 \
midrule
mr{Pepe} & mr{a} & mr{b} & mr{c} & mr{d} & e \
& & & & & f \
midrule
& & & & & \ % no need for "multicolumn{1}{l}{}" stuff
bottomrule
end{tabular*}
end{table}
end{document}
edited yesterday
answered yesterday
MicoMico
277k30379767
277k30379767
add a comment |
add a comment |
As @daleif mentioned you forgot to add the second bracket with your columns' specification {cccccc}
.
I give you a MWE:
documentclass{article}
usepackage{tabularx}
begin{document}
begin{table}
caption{BLA, BLA, BLA.}
centering
begin{tabularx}{.3textwidth}{c}
hlinehline
My table header\
hline
My table contents\
hlinehline
end{tabularx}
end{table}
end{document}
Supplement
Additionally, keep in mind that there is a package called tabu, which is more powerful than tabularx.
New contributor
3
It does not make any sense to use tabularx with no X columns, then you could just as well have used tabular
– daleif
yesterday
I agree with you, the package aim is to adapt the space between columns, e.g.begin{tabularx}{250pt}{|c|X|c|X|}...
– peterdelarue
yesterday
Your MWE, which contains atabularx
column with a single column of typec
, does not really solved the OP's question, which was about a table with six [6] columns. Please consider editing your LaTeX code so that it more directly addresses the OP's needs.
– Mico
yesterday
add a comment |
As @daleif mentioned you forgot to add the second bracket with your columns' specification {cccccc}
.
I give you a MWE:
documentclass{article}
usepackage{tabularx}
begin{document}
begin{table}
caption{BLA, BLA, BLA.}
centering
begin{tabularx}{.3textwidth}{c}
hlinehline
My table header\
hline
My table contents\
hlinehline
end{tabularx}
end{table}
end{document}
Supplement
Additionally, keep in mind that there is a package called tabu, which is more powerful than tabularx.
New contributor
3
It does not make any sense to use tabularx with no X columns, then you could just as well have used tabular
– daleif
yesterday
I agree with you, the package aim is to adapt the space between columns, e.g.begin{tabularx}{250pt}{|c|X|c|X|}...
– peterdelarue
yesterday
Your MWE, which contains atabularx
column with a single column of typec
, does not really solved the OP's question, which was about a table with six [6] columns. Please consider editing your LaTeX code so that it more directly addresses the OP's needs.
– Mico
yesterday
add a comment |
As @daleif mentioned you forgot to add the second bracket with your columns' specification {cccccc}
.
I give you a MWE:
documentclass{article}
usepackage{tabularx}
begin{document}
begin{table}
caption{BLA, BLA, BLA.}
centering
begin{tabularx}{.3textwidth}{c}
hlinehline
My table header\
hline
My table contents\
hlinehline
end{tabularx}
end{table}
end{document}
Supplement
Additionally, keep in mind that there is a package called tabu, which is more powerful than tabularx.
New contributor
As @daleif mentioned you forgot to add the second bracket with your columns' specification {cccccc}
.
I give you a MWE:
documentclass{article}
usepackage{tabularx}
begin{document}
begin{table}
caption{BLA, BLA, BLA.}
centering
begin{tabularx}{.3textwidth}{c}
hlinehline
My table header\
hline
My table contents\
hlinehline
end{tabularx}
end{table}
end{document}
Supplement
Additionally, keep in mind that there is a package called tabu, which is more powerful than tabularx.
New contributor
New contributor
answered yesterday
peterdelaruepeterdelarue
335
335
New contributor
New contributor
3
It does not make any sense to use tabularx with no X columns, then you could just as well have used tabular
– daleif
yesterday
I agree with you, the package aim is to adapt the space between columns, e.g.begin{tabularx}{250pt}{|c|X|c|X|}...
– peterdelarue
yesterday
Your MWE, which contains atabularx
column with a single column of typec
, does not really solved the OP's question, which was about a table with six [6] columns. Please consider editing your LaTeX code so that it more directly addresses the OP's needs.
– Mico
yesterday
add a comment |
3
It does not make any sense to use tabularx with no X columns, then you could just as well have used tabular
– daleif
yesterday
I agree with you, the package aim is to adapt the space between columns, e.g.begin{tabularx}{250pt}{|c|X|c|X|}...
– peterdelarue
yesterday
Your MWE, which contains atabularx
column with a single column of typec
, does not really solved the OP's question, which was about a table with six [6] columns. Please consider editing your LaTeX code so that it more directly addresses the OP's needs.
– Mico
yesterday
3
3
It does not make any sense to use tabularx with no X columns, then you could just as well have used tabular
– daleif
yesterday
It does not make any sense to use tabularx with no X columns, then you could just as well have used tabular
– daleif
yesterday
I agree with you, the package aim is to adapt the space between columns, e.g.
begin{tabularx}{250pt}{|c|X|c|X|}...
– peterdelarue
yesterday
I agree with you, the package aim is to adapt the space between columns, e.g.
begin{tabularx}{250pt}{|c|X|c|X|}...
– peterdelarue
yesterday
Your MWE, which contains a
tabularx
column with a single column of type c
, does not really solved the OP's question, which was about a table with six [6] columns. Please consider editing your LaTeX code so that it more directly addresses the OP's needs.– Mico
yesterday
Your MWE, which contains a
tabularx
column with a single column of type c
, does not really solved the OP's question, which was about a table with six [6] columns. Please consider editing your LaTeX code so that it more directly addresses the OP's needs.– Mico
yesterday
add a comment |
You do not need multicolumns in every cell, nor multirow{2}{*}{...}
, nor tabularx
or tabular*
to extend the text width, nor empty rows. Here you have enough with m
columns (of array package) and, of course, with booktabs
: :)
documentclass{article}
usepackage{graphicx,array,booktabs}
begin{document}
begin{table}
caption{My caption}
newcolumntype{C}{>{centeringarraybackslash}m{dimexprlinewidth/6-2tabcolsep}}
begin{tabular}{CCCCCC}toprule
1 & 2 & 3 & 4 & 5 & 6 \midrule
Pepe & a & b & c & d &epar f\bottomrule
end{tabular}
end{table}
end{document}
By the way, I would not use columns of more two-three em
here. Widening the table as much as possible instead of a small centered table does not make it more beautiful, but ugly scattered.
add a comment |
You do not need multicolumns in every cell, nor multirow{2}{*}{...}
, nor tabularx
or tabular*
to extend the text width, nor empty rows. Here you have enough with m
columns (of array package) and, of course, with booktabs
: :)
documentclass{article}
usepackage{graphicx,array,booktabs}
begin{document}
begin{table}
caption{My caption}
newcolumntype{C}{>{centeringarraybackslash}m{dimexprlinewidth/6-2tabcolsep}}
begin{tabular}{CCCCCC}toprule
1 & 2 & 3 & 4 & 5 & 6 \midrule
Pepe & a & b & c & d &epar f\bottomrule
end{tabular}
end{table}
end{document}
By the way, I would not use columns of more two-three em
here. Widening the table as much as possible instead of a small centered table does not make it more beautiful, but ugly scattered.
add a comment |
You do not need multicolumns in every cell, nor multirow{2}{*}{...}
, nor tabularx
or tabular*
to extend the text width, nor empty rows. Here you have enough with m
columns (of array package) and, of course, with booktabs
: :)
documentclass{article}
usepackage{graphicx,array,booktabs}
begin{document}
begin{table}
caption{My caption}
newcolumntype{C}{>{centeringarraybackslash}m{dimexprlinewidth/6-2tabcolsep}}
begin{tabular}{CCCCCC}toprule
1 & 2 & 3 & 4 & 5 & 6 \midrule
Pepe & a & b & c & d &epar f\bottomrule
end{tabular}
end{table}
end{document}
By the way, I would not use columns of more two-three em
here. Widening the table as much as possible instead of a small centered table does not make it more beautiful, but ugly scattered.
You do not need multicolumns in every cell, nor multirow{2}{*}{...}
, nor tabularx
or tabular*
to extend the text width, nor empty rows. Here you have enough with m
columns (of array package) and, of course, with booktabs
: :)
documentclass{article}
usepackage{graphicx,array,booktabs}
begin{document}
begin{table}
caption{My caption}
newcolumntype{C}{>{centeringarraybackslash}m{dimexprlinewidth/6-2tabcolsep}}
begin{tabular}{CCCCCC}toprule
1 & 2 & 3 & 4 & 5 & 6 \midrule
Pepe & a & b & c & d &epar f\bottomrule
end{tabular}
end{table}
end{document}
By the way, I would not use columns of more two-three em
here. Widening the table as much as possible instead of a small centered table does not make it more beautiful, but ugly scattered.
answered yesterday
FranFran
52.2k6115178
52.2k6115178
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%2f472188%2ftabularx-environment%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
A tip: If you indent lines by 4 spaces or enclose words in backticks
`
, they'll be marked as code, as can be seen in my edit. You can also highlight the code and click the "code" button (with "{}" on it).– Tiuri
yesterday
Remember, tabularx takes two arguments, you only listed one
– daleif
yesterday
1
Centering a box of
textwidth
? Resize a a small table ? Multicolumns of 1 column? Another suggestion: Do no use table generators, the resulting code is garbage.– Fran
yesterday