Make tabular span textwidth exactly [duplicate]
This question already has an answer here:
How to force a table into page width?
7 answers
Consider this example:
documentclass{report}
usepackage{lipsum}
begin{document}
begin{tabular}{lll}
A & B & lipsum[1][1-3]
end{tabular}
end{document}
In the output:
the last column goes out of the bounds of the page. I could constrain the last column by usingbegin{tabular}{llp{3cm}}
. However, it would be more convenient to make the table span textwidth automatically. How to do it?
tables
marked as duplicate by Werner
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Jan 19 at 19:59
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
This question already has an answer here:
How to force a table into page width?
7 answers
Consider this example:
documentclass{report}
usepackage{lipsum}
begin{document}
begin{tabular}{lll}
A & B & lipsum[1][1-3]
end{tabular}
end{document}
In the output:
the last column goes out of the bounds of the page. I could constrain the last column by usingbegin{tabular}{llp{3cm}}
. However, it would be more convenient to make the table span textwidth automatically. How to do it?
tables
marked as duplicate by Werner
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Jan 19 at 19:59
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
tabularx
is probably what you are looking for.
– moewe
Jan 19 at 19:30
you should use table with prescribed width. for exampletabular*
withp
column type ortabularx
.
– Zarko
Jan 19 at 19:30
@Zarko, could you please provide an elaborate answer?
– Viesturs
Jan 19 at 19:33
add a comment |
This question already has an answer here:
How to force a table into page width?
7 answers
Consider this example:
documentclass{report}
usepackage{lipsum}
begin{document}
begin{tabular}{lll}
A & B & lipsum[1][1-3]
end{tabular}
end{document}
In the output:
the last column goes out of the bounds of the page. I could constrain the last column by usingbegin{tabular}{llp{3cm}}
. However, it would be more convenient to make the table span textwidth automatically. How to do it?
tables
This question already has an answer here:
How to force a table into page width?
7 answers
Consider this example:
documentclass{report}
usepackage{lipsum}
begin{document}
begin{tabular}{lll}
A & B & lipsum[1][1-3]
end{tabular}
end{document}
In the output:
the last column goes out of the bounds of the page. I could constrain the last column by usingbegin{tabular}{llp{3cm}}
. However, it would be more convenient to make the table span textwidth automatically. How to do it?
This question already has an answer here:
How to force a table into page width?
7 answers
tables
tables
asked Jan 19 at 19:28
ViestursViesturs
1,65031123
1,65031123
marked as duplicate by Werner
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Jan 19 at 19:59
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
marked as duplicate by Werner
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Jan 19 at 19:59
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
tabularx
is probably what you are looking for.
– moewe
Jan 19 at 19:30
you should use table with prescribed width. for exampletabular*
withp
column type ortabularx
.
– Zarko
Jan 19 at 19:30
@Zarko, could you please provide an elaborate answer?
– Viesturs
Jan 19 at 19:33
add a comment |
tabularx
is probably what you are looking for.
– moewe
Jan 19 at 19:30
you should use table with prescribed width. for exampletabular*
withp
column type ortabularx
.
– Zarko
Jan 19 at 19:30
@Zarko, could you please provide an elaborate answer?
– Viesturs
Jan 19 at 19:33
tabularx
is probably what you are looking for.– moewe
Jan 19 at 19:30
tabularx
is probably what you are looking for.– moewe
Jan 19 at 19:30
you should use table with prescribed width. for example
tabular*
with p
column type or tabularx
.– Zarko
Jan 19 at 19:30
you should use table with prescribed width. for example
tabular*
with p
column type or tabularx
.– Zarko
Jan 19 at 19:30
@Zarko, could you please provide an elaborate answer?
– Viesturs
Jan 19 at 19:33
@Zarko, could you please provide an elaborate answer?
– Viesturs
Jan 19 at 19:33
add a comment |
1 Answer
1
active
oldest
votes
with tabularx
package is simple:
documentclass{report}
usepackage{tabularx} % <---
usepackage{lipsum}
noindent
begin{document}
begin{tabularx}{linewidth}{llX} % table width is determined with linewidth
% at least one column had to be `X` type
A & B & lipsum[66]
end{tabularx}
noindent
begin{tabularx}{linewidth}{@{} llX @{}} % border tabcolsep is suppressed
A & B & lipsum[66]
end{tabularx}
begin{table}[htb] % table is in float environment
begin{tabularx}{linewidth}{@{}llX@{}} % border tabcolsep is suppressed
A & B & lipsum[66]
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
with tabularx
package is simple:
documentclass{report}
usepackage{tabularx} % <---
usepackage{lipsum}
noindent
begin{document}
begin{tabularx}{linewidth}{llX} % table width is determined with linewidth
% at least one column had to be `X` type
A & B & lipsum[66]
end{tabularx}
noindent
begin{tabularx}{linewidth}{@{} llX @{}} % border tabcolsep is suppressed
A & B & lipsum[66]
end{tabularx}
begin{table}[htb] % table is in float environment
begin{tabularx}{linewidth}{@{}llX@{}} % border tabcolsep is suppressed
A & B & lipsum[66]
end{tabularx}
end{table}
end{document}
add a comment |
with tabularx
package is simple:
documentclass{report}
usepackage{tabularx} % <---
usepackage{lipsum}
noindent
begin{document}
begin{tabularx}{linewidth}{llX} % table width is determined with linewidth
% at least one column had to be `X` type
A & B & lipsum[66]
end{tabularx}
noindent
begin{tabularx}{linewidth}{@{} llX @{}} % border tabcolsep is suppressed
A & B & lipsum[66]
end{tabularx}
begin{table}[htb] % table is in float environment
begin{tabularx}{linewidth}{@{}llX@{}} % border tabcolsep is suppressed
A & B & lipsum[66]
end{tabularx}
end{table}
end{document}
add a comment |
with tabularx
package is simple:
documentclass{report}
usepackage{tabularx} % <---
usepackage{lipsum}
noindent
begin{document}
begin{tabularx}{linewidth}{llX} % table width is determined with linewidth
% at least one column had to be `X` type
A & B & lipsum[66]
end{tabularx}
noindent
begin{tabularx}{linewidth}{@{} llX @{}} % border tabcolsep is suppressed
A & B & lipsum[66]
end{tabularx}
begin{table}[htb] % table is in float environment
begin{tabularx}{linewidth}{@{}llX@{}} % border tabcolsep is suppressed
A & B & lipsum[66]
end{tabularx}
end{table}
end{document}
with tabularx
package is simple:
documentclass{report}
usepackage{tabularx} % <---
usepackage{lipsum}
noindent
begin{document}
begin{tabularx}{linewidth}{llX} % table width is determined with linewidth
% at least one column had to be `X` type
A & B & lipsum[66]
end{tabularx}
noindent
begin{tabularx}{linewidth}{@{} llX @{}} % border tabcolsep is suppressed
A & B & lipsum[66]
end{tabularx}
begin{table}[htb] % table is in float environment
begin{tabularx}{linewidth}{@{}llX@{}} % border tabcolsep is suppressed
A & B & lipsum[66]
end{tabularx}
end{table}
end{document}
edited Jan 19 at 20:17
answered Jan 19 at 19:36
ZarkoZarko
123k865161
123k865161
add a comment |
add a comment |
tabularx
is probably what you are looking for.– moewe
Jan 19 at 19:30
you should use table with prescribed width. for example
tabular*
withp
column type ortabularx
.– Zarko
Jan 19 at 19:30
@Zarko, could you please provide an elaborate answer?
– Viesturs
Jan 19 at 19:33