How to have table with 4 rows and 3 columns, with dotted lines
up vote
4
down vote
favorite
Given this dotted line functionality:
newcommand{adot}[1]{tikz[baseline=(todotted.base)]{node[inner sep=0pt,outer sep=0pt] (todotted) {#1};draw[dotted, thick,inner sep=0pt,transform canvas={yshift=-2pt}] (todotted.south west) -- (todotted.south east);}}
I'm wondering how to sort of create a table that looks like this:
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex
ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur
sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt
mollit anim id est laborum.
foo ............. ............. .............
hello ............. ............. .............
asdf ............. ............. .............
something ............. ............. .............
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex
ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur
sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt
mollit anim id est laborum.
That is, the table is centered, and there is space between the rows, the first column is dynamically sized based on the largest string, while the others are fixed size but they fill up the remaining space of the page, while leaving a small gap on each side.
My first attempt starts at this:
begin{center}
begin{tabular}{ c c c }
adot{foo} & adot{foo} & adot{foo} \
adot{foo} & adot{foo} & adot{foo} \
adot{foo} & adot{foo} & adot{foo}
end{tabular}
end{center}
But it leaves a lot out. The rows are a fixed width in this example, which I would like to instead be dynamic width (with a minimum size set perhaps).
tables
add a comment |
up vote
4
down vote
favorite
Given this dotted line functionality:
newcommand{adot}[1]{tikz[baseline=(todotted.base)]{node[inner sep=0pt,outer sep=0pt] (todotted) {#1};draw[dotted, thick,inner sep=0pt,transform canvas={yshift=-2pt}] (todotted.south west) -- (todotted.south east);}}
I'm wondering how to sort of create a table that looks like this:
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex
ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur
sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt
mollit anim id est laborum.
foo ............. ............. .............
hello ............. ............. .............
asdf ............. ............. .............
something ............. ............. .............
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex
ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur
sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt
mollit anim id est laborum.
That is, the table is centered, and there is space between the rows, the first column is dynamically sized based on the largest string, while the others are fixed size but they fill up the remaining space of the page, while leaving a small gap on each side.
My first attempt starts at this:
begin{center}
begin{tabular}{ c c c }
adot{foo} & adot{foo} & adot{foo} \
adot{foo} & adot{foo} & adot{foo} \
adot{foo} & adot{foo} & adot{foo}
end{tabular}
end{center}
But it leaves a lot out. The rows are a fixed width in this example, which I would like to instead be dynamic width (with a minimum size set perhaps).
tables
Yes, in my latex table the rows are accidentally fixed width. Instead, I would like for the 3 columns (with the dots in them) to be all the same width, but fill the width of the page (but leave some gap on the outside of the table).
– Lance Pollard
Dec 6 at 6:44
add a comment |
up vote
4
down vote
favorite
up vote
4
down vote
favorite
Given this dotted line functionality:
newcommand{adot}[1]{tikz[baseline=(todotted.base)]{node[inner sep=0pt,outer sep=0pt] (todotted) {#1};draw[dotted, thick,inner sep=0pt,transform canvas={yshift=-2pt}] (todotted.south west) -- (todotted.south east);}}
I'm wondering how to sort of create a table that looks like this:
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex
ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur
sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt
mollit anim id est laborum.
foo ............. ............. .............
hello ............. ............. .............
asdf ............. ............. .............
something ............. ............. .............
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex
ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur
sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt
mollit anim id est laborum.
That is, the table is centered, and there is space between the rows, the first column is dynamically sized based on the largest string, while the others are fixed size but they fill up the remaining space of the page, while leaving a small gap on each side.
My first attempt starts at this:
begin{center}
begin{tabular}{ c c c }
adot{foo} & adot{foo} & adot{foo} \
adot{foo} & adot{foo} & adot{foo} \
adot{foo} & adot{foo} & adot{foo}
end{tabular}
end{center}
But it leaves a lot out. The rows are a fixed width in this example, which I would like to instead be dynamic width (with a minimum size set perhaps).
tables
Given this dotted line functionality:
newcommand{adot}[1]{tikz[baseline=(todotted.base)]{node[inner sep=0pt,outer sep=0pt] (todotted) {#1};draw[dotted, thick,inner sep=0pt,transform canvas={yshift=-2pt}] (todotted.south west) -- (todotted.south east);}}
I'm wondering how to sort of create a table that looks like this:
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex
ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur
sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt
mollit anim id est laborum.
foo ............. ............. .............
hello ............. ............. .............
asdf ............. ............. .............
something ............. ............. .............
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex
ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur
sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt
mollit anim id est laborum.
That is, the table is centered, and there is space between the rows, the first column is dynamically sized based on the largest string, while the others are fixed size but they fill up the remaining space of the page, while leaving a small gap on each side.
My first attempt starts at this:
begin{center}
begin{tabular}{ c c c }
adot{foo} & adot{foo} & adot{foo} \
adot{foo} & adot{foo} & adot{foo} \
adot{foo} & adot{foo} & adot{foo}
end{tabular}
end{center}
But it leaves a lot out. The rows are a fixed width in this example, which I would like to instead be dynamic width (with a minimum size set perhaps).
tables
tables
asked Dec 6 at 6:10
Lance Pollard
684415
684415
Yes, in my latex table the rows are accidentally fixed width. Instead, I would like for the 3 columns (with the dots in them) to be all the same width, but fill the width of the page (but leave some gap on the outside of the table).
– Lance Pollard
Dec 6 at 6:44
add a comment |
Yes, in my latex table the rows are accidentally fixed width. Instead, I would like for the 3 columns (with the dots in them) to be all the same width, but fill the width of the page (but leave some gap on the outside of the table).
– Lance Pollard
Dec 6 at 6:44
Yes, in my latex table the rows are accidentally fixed width. Instead, I would like for the 3 columns (with the dots in them) to be all the same width, but fill the width of the page (but leave some gap on the outside of the table).
– Lance Pollard
Dec 6 at 6:44
Yes, in my latex table the rows are accidentally fixed width. Instead, I would like for the 3 columns (with the dots in them) to be all the same width, but fill the width of the page (but leave some gap on the outside of the table).
– Lance Pollard
Dec 6 at 6:44
add a comment |
1 Answer
1
active
oldest
votes
up vote
4
down vote
accepted
Use a tabularx
with dotfill
s in the X
-columns:
documentclass{article}
usepackage{lipsum}
usepackage{tabularx,collcell}
newcommand{dotcell}[1]{%
makebox[hsize]{#1}%
raisebox{-.2normalbaselineskip}[0pt][0pt]{%
makebox[0pt][r]{makebox[hsize]{dotfill}}}%
}
begin{document}
lipsum[1]
begingroup
medskip
renewcommand{arraystretch}{1.5}%
noindent
begin{tabularx}{linewidth}{ l *{3}{>{collectcelldotcell}X<{endcollectcell}} }
foo & foo & & \
hello & & goo & \
asdf & & & bar \
something & baz & &
end{tabularx}
medskip
endgroup
lipsum[2]
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',
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%2f463461%2fhow-to-have-table-with-4-rows-and-3-columns-with-dotted-lines%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
4
down vote
accepted
Use a tabularx
with dotfill
s in the X
-columns:
documentclass{article}
usepackage{lipsum}
usepackage{tabularx,collcell}
newcommand{dotcell}[1]{%
makebox[hsize]{#1}%
raisebox{-.2normalbaselineskip}[0pt][0pt]{%
makebox[0pt][r]{makebox[hsize]{dotfill}}}%
}
begin{document}
lipsum[1]
begingroup
medskip
renewcommand{arraystretch}{1.5}%
noindent
begin{tabularx}{linewidth}{ l *{3}{>{collectcelldotcell}X<{endcollectcell}} }
foo & foo & & \
hello & & goo & \
asdf & & & bar \
something & baz & &
end{tabularx}
medskip
endgroup
lipsum[2]
end{document}
add a comment |
up vote
4
down vote
accepted
Use a tabularx
with dotfill
s in the X
-columns:
documentclass{article}
usepackage{lipsum}
usepackage{tabularx,collcell}
newcommand{dotcell}[1]{%
makebox[hsize]{#1}%
raisebox{-.2normalbaselineskip}[0pt][0pt]{%
makebox[0pt][r]{makebox[hsize]{dotfill}}}%
}
begin{document}
lipsum[1]
begingroup
medskip
renewcommand{arraystretch}{1.5}%
noindent
begin{tabularx}{linewidth}{ l *{3}{>{collectcelldotcell}X<{endcollectcell}} }
foo & foo & & \
hello & & goo & \
asdf & & & bar \
something & baz & &
end{tabularx}
medskip
endgroup
lipsum[2]
end{document}
add a comment |
up vote
4
down vote
accepted
up vote
4
down vote
accepted
Use a tabularx
with dotfill
s in the X
-columns:
documentclass{article}
usepackage{lipsum}
usepackage{tabularx,collcell}
newcommand{dotcell}[1]{%
makebox[hsize]{#1}%
raisebox{-.2normalbaselineskip}[0pt][0pt]{%
makebox[0pt][r]{makebox[hsize]{dotfill}}}%
}
begin{document}
lipsum[1]
begingroup
medskip
renewcommand{arraystretch}{1.5}%
noindent
begin{tabularx}{linewidth}{ l *{3}{>{collectcelldotcell}X<{endcollectcell}} }
foo & foo & & \
hello & & goo & \
asdf & & & bar \
something & baz & &
end{tabularx}
medskip
endgroup
lipsum[2]
end{document}
Use a tabularx
with dotfill
s in the X
-columns:
documentclass{article}
usepackage{lipsum}
usepackage{tabularx,collcell}
newcommand{dotcell}[1]{%
makebox[hsize]{#1}%
raisebox{-.2normalbaselineskip}[0pt][0pt]{%
makebox[0pt][r]{makebox[hsize]{dotfill}}}%
}
begin{document}
lipsum[1]
begingroup
medskip
renewcommand{arraystretch}{1.5}%
noindent
begin{tabularx}{linewidth}{ l *{3}{>{collectcelldotcell}X<{endcollectcell}} }
foo & foo & & \
hello & & goo & \
asdf & & & bar \
something & baz & &
end{tabularx}
medskip
endgroup
lipsum[2]
end{document}
edited Dec 6 at 7:45
answered Dec 6 at 7:15
Werner
435k619531641
435k619531641
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.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- 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%2f463461%2fhow-to-have-table-with-4-rows-and-3-columns-with-dotted-lines%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
Yes, in my latex table the rows are accidentally fixed width. Instead, I would like for the 3 columns (with the dots in them) to be all the same width, but fill the width of the page (but leave some gap on the outside of the table).
– Lance Pollard
Dec 6 at 6:44