Make tabular span textwidth exactly [duplicate]












1
















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:
enter image description here



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?










share|improve this question













marked as duplicate by Werner tables
Users with the  tables badge can single-handedly close tables questions as duplicates and reopen them as needed.

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 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
















1
















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:
enter image description here



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?










share|improve this question













marked as duplicate by Werner tables
Users with the  tables badge can single-handedly close tables questions as duplicates and reopen them as needed.

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 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














1












1








1









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:
enter image description here



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?










share|improve this question















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:
enter image description here



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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 19 at 19:28









ViestursViesturs

1,65031123




1,65031123




marked as duplicate by Werner tables
Users with the  tables badge can single-handedly close tables questions as duplicates and reopen them as needed.

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 tables
Users with the  tables badge can single-handedly close tables questions as duplicates and reopen them as needed.

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 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



















  • 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













  • @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










1 Answer
1






active

oldest

votes


















1














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}


enter image description here






share|improve this answer
































    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    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}


    enter image description here






    share|improve this answer






























      1














      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}


      enter image description here






      share|improve this answer




























        1












        1








        1







        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}


        enter image description here






        share|improve this answer















        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}


        enter image description here







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Jan 19 at 20:17

























        answered Jan 19 at 19:36









        ZarkoZarko

        123k865161




        123k865161















            Popular posts from this blog

            How to change which sound is reproduced for terminal bell?

            Can I use Tabulator js library in my java Spring + Thymeleaf project?

            Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents