Automatically creating table with bordersHow can I automatically calculate sums in a LaTeX table?Compile...
The use of SlotSequence in If[#1 > #2, ##] &
Repair drywall and protect wires on back of electrical panel
What plausible reasons why people forget they didn't originally live on this new planet?
How to load GeoJSON data in OpenLayers?
What does "away to insignificance" mean?
FPGA starts working after irrelevant changes, why?
Why did my relationship with my wife go down by two hearts?
Protecting yourself against OSINT?
As a vegetarian, how can I deal with microwaves smelling of meat and fish?
Modeling the Round (Nearest Integer) function
is it biologically possible for a creature that can be compatible to reproduce with any creature?
How to get to Antarctica without using a travel company
Most optimal hallways with random gravity inside?
Options for passes to national parks in Arizona/Utah for 5 people travelling in one car
Stamp of electrical department on letter head of recommendation letter
How would a race of humanoids with tails design [vehicle] seats?
What is an informed evaluation of resource availability?
Why didn't Aboriginal Australians discover agriculture?
Did Bobby Fischer actually write "Bobby Fischer Teaches Chess"
Why doesn't the nucleus have "nucleus-probability cloud"?
Does using an img title attribute in addition to the alt attribute help image SEO?
Can Microsoft employees see my data in Azure?
Automatically creating table with borders
Where are ms paint icons stored?
Automatically creating table with borders
How can I automatically calculate sums in a LaTeX table?Compile Latex table without begin{document}?Vertically aligning fixed height tablesHow to create a table automatically for a homework in statistics?table multicolumn: even rows under odd rowsNote at end of table rowHow to set longtable width to text width so that the text in cell wraps around automatically?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{
margin-bottom:0;
}
Is there a way (something like a package) that if I write the code:
begin{table}[]
begin{tabular}{lr}
Country & Counted \
Australia & 690 \
Germany & 1000 \
Poland & 240 \
India & 5397
end{tabular}
end{table}
I get automatically the output like:
begin{table}[]
begin{tabular}{|l|r|}
hline
Country & Counted \ hline
Australia & 690 \ hline
Germany & 1000 \ hline
Poland & 240 \ hline
India & 5397 \ hline
end{tabular}
end{table}
Without writing the | and hline
tables
New contributor
add a comment
|
Is there a way (something like a package) that if I write the code:
begin{table}[]
begin{tabular}{lr}
Country & Counted \
Australia & 690 \
Germany & 1000 \
Poland & 240 \
India & 5397
end{tabular}
end{table}
I get automatically the output like:
begin{table}[]
begin{tabular}{|l|r|}
hline
Country & Counted \ hline
Australia & 690 \ hline
Germany & 1000 \ hline
Poland & 240 \ hline
India & 5397 \ hline
end{tabular}
end{table}
Without writing the | and hline
tables
New contributor
2
Welcome to TeX.SE.
– Mico
10 hours ago
add a comment
|
Is there a way (something like a package) that if I write the code:
begin{table}[]
begin{tabular}{lr}
Country & Counted \
Australia & 690 \
Germany & 1000 \
Poland & 240 \
India & 5397
end{tabular}
end{table}
I get automatically the output like:
begin{table}[]
begin{tabular}{|l|r|}
hline
Country & Counted \ hline
Australia & 690 \ hline
Germany & 1000 \ hline
Poland & 240 \ hline
India & 5397 \ hline
end{tabular}
end{table}
Without writing the | and hline
tables
New contributor
Is there a way (something like a package) that if I write the code:
begin{table}[]
begin{tabular}{lr}
Country & Counted \
Australia & 690 \
Germany & 1000 \
Poland & 240 \
India & 5397
end{tabular}
end{table}
I get automatically the output like:
begin{table}[]
begin{tabular}{|l|r|}
hline
Country & Counted \ hline
Australia & 690 \ hline
Germany & 1000 \ hline
Poland & 240 \ hline
India & 5397 \ hline
end{tabular}
end{table}
Without writing the | and hline
tables
tables
New contributor
New contributor
edited 8 hours ago
N. F. Taussig
1807 bronze badges
1807 bronze badges
New contributor
asked 10 hours ago
jennifer ruursjennifer ruurs
233 bronze badges
233 bronze badges
New contributor
New contributor
2
Welcome to TeX.SE.
– Mico
10 hours ago
add a comment
|
2
Welcome to TeX.SE.
– Mico
10 hours ago
2
2
Welcome to TeX.SE.
– Mico
10 hours ago
Welcome to TeX.SE.
– Mico
10 hours ago
add a comment
|
2 Answers
2
active
oldest
votes
I assume the purpose of this is to reduce the typing you have to do? If so, one option is to use a macro. (If this is not the purpose, I will delete this answer)
documentclass[12pt]{article}%
newcommand{addline}[2]{%
#1 & #2 \ hline
}
begin{document}
begin{table}[]
begin{tabular}{|l|r|}
hline
addline{Country}{Counted}
addline{Australia}{690}
addline{Germany}{1000}
addline{Poland}{240}
addline{India}{5397}
end{tabular}
end{table}
end{document}
This is indeed the purpose awesome!
– jennifer ruurs
9 hours ago
add a comment
|
Encasing a table in lots and lots of vertical and horizontal lines pretty much guarantees that the result will look like something that is viewed through a barred prison cell window. Not exactly inviting! It's certainly true that the "prison cell window look" is encountered rather frequently in scientific publications. However, that not a truly good reason for continuing this visually and aesthetically dubious practice.
My idea of making the table even better looking would be to (a) use no vertical bars at all, (b) use few, but well-spaced, horizontal bars, and (c) align the numbers in the data column on their (implicit) decimal marker.
documentclass{article}
usepackage{siunitx} % for 'S' column type
usepackage{booktabs}% for toprule, midrule, and bottomrule macros
begin{document}
noindent
begin{tabular}{@{} lr @{}}
Country & Counted \
Australia & 690 \
Germany & 1000 \
Poland & 240 \
India & 5397
end{tabular}
qquad
begin{tabular}{|l|r|}
hline
Country & Counted \ hline
Australia & 690 \ hline
Germany & 1000 \ hline
Poland & 240 \ hline
India & 5397 \ hline
end{tabular}
qquad
%% do consider the following approach:
begin{tabular}{@{} lS[table-format=4.0] @{}}
toprule
Country & {Counted} \ % 'Counted' is placed in curly braces
midrule
Australia & 690 \
Germany & 1000 \
Poland & 240 \
India & 5397 \
bottomrule
end{tabular}
end{document}
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/4.0/"u003ecc by-sa 4.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
});
}
});
jennifer ruurs 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%2f512053%2fautomatically-creating-table-with-borders%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
I assume the purpose of this is to reduce the typing you have to do? If so, one option is to use a macro. (If this is not the purpose, I will delete this answer)
documentclass[12pt]{article}%
newcommand{addline}[2]{%
#1 & #2 \ hline
}
begin{document}
begin{table}[]
begin{tabular}{|l|r|}
hline
addline{Country}{Counted}
addline{Australia}{690}
addline{Germany}{1000}
addline{Poland}{240}
addline{India}{5397}
end{tabular}
end{table}
end{document}
This is indeed the purpose awesome!
– jennifer ruurs
9 hours ago
add a comment
|
I assume the purpose of this is to reduce the typing you have to do? If so, one option is to use a macro. (If this is not the purpose, I will delete this answer)
documentclass[12pt]{article}%
newcommand{addline}[2]{%
#1 & #2 \ hline
}
begin{document}
begin{table}[]
begin{tabular}{|l|r|}
hline
addline{Country}{Counted}
addline{Australia}{690}
addline{Germany}{1000}
addline{Poland}{240}
addline{India}{5397}
end{tabular}
end{table}
end{document}
This is indeed the purpose awesome!
– jennifer ruurs
9 hours ago
add a comment
|
I assume the purpose of this is to reduce the typing you have to do? If so, one option is to use a macro. (If this is not the purpose, I will delete this answer)
documentclass[12pt]{article}%
newcommand{addline}[2]{%
#1 & #2 \ hline
}
begin{document}
begin{table}[]
begin{tabular}{|l|r|}
hline
addline{Country}{Counted}
addline{Australia}{690}
addline{Germany}{1000}
addline{Poland}{240}
addline{India}{5397}
end{tabular}
end{table}
end{document}
I assume the purpose of this is to reduce the typing you have to do? If so, one option is to use a macro. (If this is not the purpose, I will delete this answer)
documentclass[12pt]{article}%
newcommand{addline}[2]{%
#1 & #2 \ hline
}
begin{document}
begin{table}[]
begin{tabular}{|l|r|}
hline
addline{Country}{Counted}
addline{Australia}{690}
addline{Germany}{1000}
addline{Poland}{240}
addline{India}{5397}
end{tabular}
end{table}
end{document}
answered 10 hours ago
NasserNasser
8,8998 gold badges37 silver badges100 bronze badges
8,8998 gold badges37 silver badges100 bronze badges
This is indeed the purpose awesome!
– jennifer ruurs
9 hours ago
add a comment
|
This is indeed the purpose awesome!
– jennifer ruurs
9 hours ago
This is indeed the purpose awesome!
– jennifer ruurs
9 hours ago
This is indeed the purpose awesome!
– jennifer ruurs
9 hours ago
add a comment
|
Encasing a table in lots and lots of vertical and horizontal lines pretty much guarantees that the result will look like something that is viewed through a barred prison cell window. Not exactly inviting! It's certainly true that the "prison cell window look" is encountered rather frequently in scientific publications. However, that not a truly good reason for continuing this visually and aesthetically dubious practice.
My idea of making the table even better looking would be to (a) use no vertical bars at all, (b) use few, but well-spaced, horizontal bars, and (c) align the numbers in the data column on their (implicit) decimal marker.
documentclass{article}
usepackage{siunitx} % for 'S' column type
usepackage{booktabs}% for toprule, midrule, and bottomrule macros
begin{document}
noindent
begin{tabular}{@{} lr @{}}
Country & Counted \
Australia & 690 \
Germany & 1000 \
Poland & 240 \
India & 5397
end{tabular}
qquad
begin{tabular}{|l|r|}
hline
Country & Counted \ hline
Australia & 690 \ hline
Germany & 1000 \ hline
Poland & 240 \ hline
India & 5397 \ hline
end{tabular}
qquad
%% do consider the following approach:
begin{tabular}{@{} lS[table-format=4.0] @{}}
toprule
Country & {Counted} \ % 'Counted' is placed in curly braces
midrule
Australia & 690 \
Germany & 1000 \
Poland & 240 \
India & 5397 \
bottomrule
end{tabular}
end{document}
add a comment
|
Encasing a table in lots and lots of vertical and horizontal lines pretty much guarantees that the result will look like something that is viewed through a barred prison cell window. Not exactly inviting! It's certainly true that the "prison cell window look" is encountered rather frequently in scientific publications. However, that not a truly good reason for continuing this visually and aesthetically dubious practice.
My idea of making the table even better looking would be to (a) use no vertical bars at all, (b) use few, but well-spaced, horizontal bars, and (c) align the numbers in the data column on their (implicit) decimal marker.
documentclass{article}
usepackage{siunitx} % for 'S' column type
usepackage{booktabs}% for toprule, midrule, and bottomrule macros
begin{document}
noindent
begin{tabular}{@{} lr @{}}
Country & Counted \
Australia & 690 \
Germany & 1000 \
Poland & 240 \
India & 5397
end{tabular}
qquad
begin{tabular}{|l|r|}
hline
Country & Counted \ hline
Australia & 690 \ hline
Germany & 1000 \ hline
Poland & 240 \ hline
India & 5397 \ hline
end{tabular}
qquad
%% do consider the following approach:
begin{tabular}{@{} lS[table-format=4.0] @{}}
toprule
Country & {Counted} \ % 'Counted' is placed in curly braces
midrule
Australia & 690 \
Germany & 1000 \
Poland & 240 \
India & 5397 \
bottomrule
end{tabular}
end{document}
add a comment
|
Encasing a table in lots and lots of vertical and horizontal lines pretty much guarantees that the result will look like something that is viewed through a barred prison cell window. Not exactly inviting! It's certainly true that the "prison cell window look" is encountered rather frequently in scientific publications. However, that not a truly good reason for continuing this visually and aesthetically dubious practice.
My idea of making the table even better looking would be to (a) use no vertical bars at all, (b) use few, but well-spaced, horizontal bars, and (c) align the numbers in the data column on their (implicit) decimal marker.
documentclass{article}
usepackage{siunitx} % for 'S' column type
usepackage{booktabs}% for toprule, midrule, and bottomrule macros
begin{document}
noindent
begin{tabular}{@{} lr @{}}
Country & Counted \
Australia & 690 \
Germany & 1000 \
Poland & 240 \
India & 5397
end{tabular}
qquad
begin{tabular}{|l|r|}
hline
Country & Counted \ hline
Australia & 690 \ hline
Germany & 1000 \ hline
Poland & 240 \ hline
India & 5397 \ hline
end{tabular}
qquad
%% do consider the following approach:
begin{tabular}{@{} lS[table-format=4.0] @{}}
toprule
Country & {Counted} \ % 'Counted' is placed in curly braces
midrule
Australia & 690 \
Germany & 1000 \
Poland & 240 \
India & 5397 \
bottomrule
end{tabular}
end{document}
Encasing a table in lots and lots of vertical and horizontal lines pretty much guarantees that the result will look like something that is viewed through a barred prison cell window. Not exactly inviting! It's certainly true that the "prison cell window look" is encountered rather frequently in scientific publications. However, that not a truly good reason for continuing this visually and aesthetically dubious practice.
My idea of making the table even better looking would be to (a) use no vertical bars at all, (b) use few, but well-spaced, horizontal bars, and (c) align the numbers in the data column on their (implicit) decimal marker.
documentclass{article}
usepackage{siunitx} % for 'S' column type
usepackage{booktabs}% for toprule, midrule, and bottomrule macros
begin{document}
noindent
begin{tabular}{@{} lr @{}}
Country & Counted \
Australia & 690 \
Germany & 1000 \
Poland & 240 \
India & 5397
end{tabular}
qquad
begin{tabular}{|l|r|}
hline
Country & Counted \ hline
Australia & 690 \ hline
Germany & 1000 \ hline
Poland & 240 \ hline
India & 5397 \ hline
end{tabular}
qquad
%% do consider the following approach:
begin{tabular}{@{} lS[table-format=4.0] @{}}
toprule
Country & {Counted} \ % 'Counted' is placed in curly braces
midrule
Australia & 690 \
Germany & 1000 \
Poland & 240 \
India & 5397 \
bottomrule
end{tabular}
end{document}
answered 10 hours ago
MicoMico
308k33 gold badges424 silver badges838 bronze badges
308k33 gold badges424 silver badges838 bronze badges
add a comment
|
add a comment
|
jennifer ruurs is a new contributor. Be nice, and check out our Code of Conduct.
jennifer ruurs is a new contributor. Be nice, and check out our Code of Conduct.
jennifer ruurs is a new contributor. Be nice, and check out our Code of Conduct.
jennifer ruurs is a new contributor. Be nice, and check out our Code of Conduct.
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%2f512053%2fautomatically-creating-table-with-borders%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
2
Welcome to TeX.SE.
– Mico
10 hours ago