Control width of columns in a tabular environment












3















I would like the pieces of texts in the right column to be closer to the pieces of text in the left column. At the same time, I want the table to accommodate long pieces of text nicely, as it does now. One way to achieve this result would be to restrict the width of the left column, augment the width of the right column, and move the left margin of the right column to the left. But I do not know how to do it.



Here is a MWE of what I got so farTable:



documentclass{article}
usepackage[utf8]{inputenc}
usepackage{booktabs}

begin{document}

begin{table}
centering
begin{tabular}{*{2}{p{.425linewidth}}}
toprule
first & second second second second second second second second second second\
midrule
third & fourth fourth fourth fourth fourth fourth fourth fourth fourth fourth \
bottomrule
end{tabular}
end{table}

end{document}


Thanks for your help.










share|improve this question




















  • 2





    You're probably looking for a setup like begin{tabularx}{linewidth}{ l X } ... end{tabularx} (requires usepackage{tabularx} in your preamble).

    – Werner
    Mar 19 at 15:27











  • Thanks very much. This indeed achieves the goal.

    – orient
    Mar 19 at 15:50
















3















I would like the pieces of texts in the right column to be closer to the pieces of text in the left column. At the same time, I want the table to accommodate long pieces of text nicely, as it does now. One way to achieve this result would be to restrict the width of the left column, augment the width of the right column, and move the left margin of the right column to the left. But I do not know how to do it.



Here is a MWE of what I got so farTable:



documentclass{article}
usepackage[utf8]{inputenc}
usepackage{booktabs}

begin{document}

begin{table}
centering
begin{tabular}{*{2}{p{.425linewidth}}}
toprule
first & second second second second second second second second second second\
midrule
third & fourth fourth fourth fourth fourth fourth fourth fourth fourth fourth \
bottomrule
end{tabular}
end{table}

end{document}


Thanks for your help.










share|improve this question




















  • 2





    You're probably looking for a setup like begin{tabularx}{linewidth}{ l X } ... end{tabularx} (requires usepackage{tabularx} in your preamble).

    – Werner
    Mar 19 at 15:27











  • Thanks very much. This indeed achieves the goal.

    – orient
    Mar 19 at 15:50














3












3








3








I would like the pieces of texts in the right column to be closer to the pieces of text in the left column. At the same time, I want the table to accommodate long pieces of text nicely, as it does now. One way to achieve this result would be to restrict the width of the left column, augment the width of the right column, and move the left margin of the right column to the left. But I do not know how to do it.



Here is a MWE of what I got so farTable:



documentclass{article}
usepackage[utf8]{inputenc}
usepackage{booktabs}

begin{document}

begin{table}
centering
begin{tabular}{*{2}{p{.425linewidth}}}
toprule
first & second second second second second second second second second second\
midrule
third & fourth fourth fourth fourth fourth fourth fourth fourth fourth fourth \
bottomrule
end{tabular}
end{table}

end{document}


Thanks for your help.










share|improve this question
















I would like the pieces of texts in the right column to be closer to the pieces of text in the left column. At the same time, I want the table to accommodate long pieces of text nicely, as it does now. One way to achieve this result would be to restrict the width of the left column, augment the width of the right column, and move the left margin of the right column to the left. But I do not know how to do it.



Here is a MWE of what I got so farTable:



documentclass{article}
usepackage[utf8]{inputenc}
usepackage{booktabs}

begin{document}

begin{table}
centering
begin{tabular}{*{2}{p{.425linewidth}}}
toprule
first & second second second second second second second second second second\
midrule
third & fourth fourth fourth fourth fourth fourth fourth fourth fourth fourth \
bottomrule
end{tabular}
end{table}

end{document}


Thanks for your help.







tables booktabs






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 19 at 15:35









Mico

284k31388778




284k31388778










asked Mar 19 at 15:24









orientorient

1445




1445








  • 2





    You're probably looking for a setup like begin{tabularx}{linewidth}{ l X } ... end{tabularx} (requires usepackage{tabularx} in your preamble).

    – Werner
    Mar 19 at 15:27











  • Thanks very much. This indeed achieves the goal.

    – orient
    Mar 19 at 15:50














  • 2





    You're probably looking for a setup like begin{tabularx}{linewidth}{ l X } ... end{tabularx} (requires usepackage{tabularx} in your preamble).

    – Werner
    Mar 19 at 15:27











  • Thanks very much. This indeed achieves the goal.

    – orient
    Mar 19 at 15:50








2




2





You're probably looking for a setup like begin{tabularx}{linewidth}{ l X } ... end{tabularx} (requires usepackage{tabularx} in your preamble).

– Werner
Mar 19 at 15:27





You're probably looking for a setup like begin{tabularx}{linewidth}{ l X } ... end{tabularx} (requires usepackage{tabularx} in your preamble).

– Werner
Mar 19 at 15:27













Thanks very much. This indeed achieves the goal.

– orient
Mar 19 at 15:50





Thanks very much. This indeed achieves the goal.

– orient
Mar 19 at 15:50










2 Answers
2






active

oldest

votes


















5














As far as I understand the question, I would try



documentclass{article}
usepackage[utf8]{inputenc}
usepackage{booktabs}

begin{document}
begin{table}
centering
begin{tabular}{l p{0.5linewidth}}
toprule
first & second second second second second second second second second second\
midrule
third & fourth fourth fourth fourth fourth fourth fourth fourth fourth fourth \
bottomrule
end{tabular}
end{table}
end{document}


to obtain



enter image description here






share|improve this answer
























  • Thanks, Denis. Your solution also works and is indeed using just the package booktabs.

    – orient
    Mar 19 at 15:51



















3














As @Werner has already pointed out in a comment, a good candidate solution for your formatting objective would be to load the tabularx package and to employ a tabularx environment (with overall width set to textwidth) instead of tabular. Then, change the first column specification from p{...} to l, and change the second column specification from p{...} to X.



enter image description here



documentclass{article}
usepackage[utf8]{inputenc}
usepackage{booktabs}
usepackage{tabularx} % for "tabularx" env. and "X" column type

begin{document}

begin{table}
begin{tabularx}{textwidth}{@{} l X @{}}
toprule
first & second second second second second second second
second second second second second second second second \
midrule
third & fourth fourth fourth fourth fourth fourth fourth fourth
fourth fourth fourth fourth \
bottomrule
end{tabularx}
end{table}

end{document}





share|improve this answer
























  • Thanks very much, Mico. Your idea does provide the solution.

    – orient
    Mar 19 at 15:51











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
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f480296%2fcontrol-width-of-columns-in-a-tabular-environment%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









5














As far as I understand the question, I would try



documentclass{article}
usepackage[utf8]{inputenc}
usepackage{booktabs}

begin{document}
begin{table}
centering
begin{tabular}{l p{0.5linewidth}}
toprule
first & second second second second second second second second second second\
midrule
third & fourth fourth fourth fourth fourth fourth fourth fourth fourth fourth \
bottomrule
end{tabular}
end{table}
end{document}


to obtain



enter image description here






share|improve this answer
























  • Thanks, Denis. Your solution also works and is indeed using just the package booktabs.

    – orient
    Mar 19 at 15:51
















5














As far as I understand the question, I would try



documentclass{article}
usepackage[utf8]{inputenc}
usepackage{booktabs}

begin{document}
begin{table}
centering
begin{tabular}{l p{0.5linewidth}}
toprule
first & second second second second second second second second second second\
midrule
third & fourth fourth fourth fourth fourth fourth fourth fourth fourth fourth \
bottomrule
end{tabular}
end{table}
end{document}


to obtain



enter image description here






share|improve this answer
























  • Thanks, Denis. Your solution also works and is indeed using just the package booktabs.

    – orient
    Mar 19 at 15:51














5












5








5







As far as I understand the question, I would try



documentclass{article}
usepackage[utf8]{inputenc}
usepackage{booktabs}

begin{document}
begin{table}
centering
begin{tabular}{l p{0.5linewidth}}
toprule
first & second second second second second second second second second second\
midrule
third & fourth fourth fourth fourth fourth fourth fourth fourth fourth fourth \
bottomrule
end{tabular}
end{table}
end{document}


to obtain



enter image description here






share|improve this answer













As far as I understand the question, I would try



documentclass{article}
usepackage[utf8]{inputenc}
usepackage{booktabs}

begin{document}
begin{table}
centering
begin{tabular}{l p{0.5linewidth}}
toprule
first & second second second second second second second second second second\
midrule
third & fourth fourth fourth fourth fourth fourth fourth fourth fourth fourth \
bottomrule
end{tabular}
end{table}
end{document}


to obtain



enter image description here







share|improve this answer












share|improve this answer



share|improve this answer










answered Mar 19 at 15:39









DenisDenis

2,638520




2,638520













  • Thanks, Denis. Your solution also works and is indeed using just the package booktabs.

    – orient
    Mar 19 at 15:51



















  • Thanks, Denis. Your solution also works and is indeed using just the package booktabs.

    – orient
    Mar 19 at 15:51

















Thanks, Denis. Your solution also works and is indeed using just the package booktabs.

– orient
Mar 19 at 15:51





Thanks, Denis. Your solution also works and is indeed using just the package booktabs.

– orient
Mar 19 at 15:51











3














As @Werner has already pointed out in a comment, a good candidate solution for your formatting objective would be to load the tabularx package and to employ a tabularx environment (with overall width set to textwidth) instead of tabular. Then, change the first column specification from p{...} to l, and change the second column specification from p{...} to X.



enter image description here



documentclass{article}
usepackage[utf8]{inputenc}
usepackage{booktabs}
usepackage{tabularx} % for "tabularx" env. and "X" column type

begin{document}

begin{table}
begin{tabularx}{textwidth}{@{} l X @{}}
toprule
first & second second second second second second second
second second second second second second second second \
midrule
third & fourth fourth fourth fourth fourth fourth fourth fourth
fourth fourth fourth fourth \
bottomrule
end{tabularx}
end{table}

end{document}





share|improve this answer
























  • Thanks very much, Mico. Your idea does provide the solution.

    – orient
    Mar 19 at 15:51
















3














As @Werner has already pointed out in a comment, a good candidate solution for your formatting objective would be to load the tabularx package and to employ a tabularx environment (with overall width set to textwidth) instead of tabular. Then, change the first column specification from p{...} to l, and change the second column specification from p{...} to X.



enter image description here



documentclass{article}
usepackage[utf8]{inputenc}
usepackage{booktabs}
usepackage{tabularx} % for "tabularx" env. and "X" column type

begin{document}

begin{table}
begin{tabularx}{textwidth}{@{} l X @{}}
toprule
first & second second second second second second second
second second second second second second second second \
midrule
third & fourth fourth fourth fourth fourth fourth fourth fourth
fourth fourth fourth fourth \
bottomrule
end{tabularx}
end{table}

end{document}





share|improve this answer
























  • Thanks very much, Mico. Your idea does provide the solution.

    – orient
    Mar 19 at 15:51














3












3








3







As @Werner has already pointed out in a comment, a good candidate solution for your formatting objective would be to load the tabularx package and to employ a tabularx environment (with overall width set to textwidth) instead of tabular. Then, change the first column specification from p{...} to l, and change the second column specification from p{...} to X.



enter image description here



documentclass{article}
usepackage[utf8]{inputenc}
usepackage{booktabs}
usepackage{tabularx} % for "tabularx" env. and "X" column type

begin{document}

begin{table}
begin{tabularx}{textwidth}{@{} l X @{}}
toprule
first & second second second second second second second
second second second second second second second second \
midrule
third & fourth fourth fourth fourth fourth fourth fourth fourth
fourth fourth fourth fourth \
bottomrule
end{tabularx}
end{table}

end{document}





share|improve this answer













As @Werner has already pointed out in a comment, a good candidate solution for your formatting objective would be to load the tabularx package and to employ a tabularx environment (with overall width set to textwidth) instead of tabular. Then, change the first column specification from p{...} to l, and change the second column specification from p{...} to X.



enter image description here



documentclass{article}
usepackage[utf8]{inputenc}
usepackage{booktabs}
usepackage{tabularx} % for "tabularx" env. and "X" column type

begin{document}

begin{table}
begin{tabularx}{textwidth}{@{} l X @{}}
toprule
first & second second second second second second second
second second second second second second second second \
midrule
third & fourth fourth fourth fourth fourth fourth fourth fourth
fourth fourth fourth fourth \
bottomrule
end{tabularx}
end{table}

end{document}






share|improve this answer












share|improve this answer



share|improve this answer










answered Mar 19 at 15:39









MicoMico

284k31388778




284k31388778













  • Thanks very much, Mico. Your idea does provide the solution.

    – orient
    Mar 19 at 15:51



















  • Thanks very much, Mico. Your idea does provide the solution.

    – orient
    Mar 19 at 15:51

















Thanks very much, Mico. Your idea does provide the solution.

– orient
Mar 19 at 15:51





Thanks very much, Mico. Your idea does provide the solution.

– orient
Mar 19 at 15:51


















draft saved

draft discarded




















































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.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f480296%2fcontrol-width-of-columns-in-a-tabular-environment%23new-answer', 'question_page');
}
);

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







Popular posts from this blog

He _____ here since 1970 . Answer needed [closed]What does “since he was so high” mean?Meaning of “catch birds for”?How do I ensure “since” takes the meaning I want?“Who cares here” meaningWhat does “right round toward” mean?the time tense (had now been detected)What does the phrase “ring around the roses” mean here?Correct usage of “visited upon”Meaning of “foiled rail sabotage bid”It was the third time I had gone to Rome or It is the third time I had been to Rome

Bunad

Færeyskur hestur Heimild | Tengill | Tilvísanir | LeiðsagnarvalRossið - síða um færeyska hrossið á færeyskuGott ár hjá færeyska hestinum