Tabular border style
up vote
23
down vote
favorite
begin{tabular}{|c|c|c|}
Column 1 & Column 2 & column3 \
hline
second row & & \
hline
end{tabular}
How do I change the border style? Using |
I can draw thin solid vertical lines and hline
draws thin solid horizontal lines. I would like a thick outer border and thin dotted lines of various sizes and colors in the table. In short I would like to achieve similar functionality of attached screenshot of MS word table options in LaTeX
. Also the reason for asking this is to put all table borders related answers in one place.
Thanks for your help.
tables border
add a comment |
up vote
23
down vote
favorite
begin{tabular}{|c|c|c|}
Column 1 & Column 2 & column3 \
hline
second row & & \
hline
end{tabular}
How do I change the border style? Using |
I can draw thin solid vertical lines and hline
draws thin solid horizontal lines. I would like a thick outer border and thin dotted lines of various sizes and colors in the table. In short I would like to achieve similar functionality of attached screenshot of MS word table options in LaTeX
. Also the reason for asking this is to put all table borders related answers in one place.
Thanks for your help.
tables border
I wouldn´t like the look of dashed lines, even in illustrations, if you can use gray lines instead.
– Benjamin McKay
Feb 17 '15 at 16:46
add a comment |
up vote
23
down vote
favorite
up vote
23
down vote
favorite
begin{tabular}{|c|c|c|}
Column 1 & Column 2 & column3 \
hline
second row & & \
hline
end{tabular}
How do I change the border style? Using |
I can draw thin solid vertical lines and hline
draws thin solid horizontal lines. I would like a thick outer border and thin dotted lines of various sizes and colors in the table. In short I would like to achieve similar functionality of attached screenshot of MS word table options in LaTeX
. Also the reason for asking this is to put all table borders related answers in one place.
Thanks for your help.
tables border
begin{tabular}{|c|c|c|}
Column 1 & Column 2 & column3 \
hline
second row & & \
hline
end{tabular}
How do I change the border style? Using |
I can draw thin solid vertical lines and hline
draws thin solid horizontal lines. I would like a thick outer border and thin dotted lines of various sizes and colors in the table. In short I would like to achieve similar functionality of attached screenshot of MS word table options in LaTeX
. Also the reason for asking this is to put all table borders related answers in one place.
Thanks for your help.
tables border
tables border
edited 18 mins ago
Solomon Ucko
1034
1034
asked Feb 4 '11 at 13:35
Aku
4,286165688
4,286165688
I wouldn´t like the look of dashed lines, even in illustrations, if you can use gray lines instead.
– Benjamin McKay
Feb 17 '15 at 16:46
add a comment |
I wouldn´t like the look of dashed lines, even in illustrations, if you can use gray lines instead.
– Benjamin McKay
Feb 17 '15 at 16:46
I wouldn´t like the look of dashed lines, even in illustrations, if you can use gray lines instead.
– Benjamin McKay
Feb 17 '15 at 16:46
I wouldn´t like the look of dashed lines, even in illustrations, if you can use gray lines instead.
– Benjamin McKay
Feb 17 '15 at 16:46
add a comment |
4 Answers
4
active
oldest
votes
up vote
15
down vote
accepted
documentclass{article}
usepackage{array,booktabs,arydshln,xcolor}
newcommandVRule[1][arrayrulewidth]{vrule width #1}
begin{document}
begin{tabular}{!{VRule[2pt]}c!{VRule}c!{color{red}VRule[3pt]}c!{VRule}}
Column 1 & Column 2 & column3 \specialrule{3pt}{0pt}{0pt}
second row & & \hdashline
third row & & \specialrule{4pt}{0pt}{0pt}
end{tabular}
end{document}
I want to add a one bold horizontal line only between the two row... this method didn't work.
– Misaki
Oct 9 '13 at 10:18
1
Please explain how this works.
– Duncan Whyte
Mar 26 at 17:53
add a comment |
up vote
13
down vote
Here are a few table layouts, with my favourite one last.
documentclass{article}
usepackage{xcolor}
usepackage{booktabs}
begin{document}
begin{tabular}{p{6cm}p{6cm}}
begin{tabular}{|c|c|c|}
hline
Column 1 & Column 2 & Column 3 \
hline
second row & & \
hline
third row & & \
hline
end{tabular}
&
begin{tabular}{ccc}
Column 1 & Column 2 & Column 3 \
hline
second row & & \
hline
third row & & \
hline
end{tabular}
\[5em]
begin{tabular}{|ccc|}
hline
Column 1 & Column 2 & Column 3 \
hline
second row & & \
third row & & \
hline
end{tabular}
&
begin{tabular}{|c|c|c|}
hline
Column 1 & Column 2 & Column 3 \
hline
second row & & \
third row & & \
hline
end{tabular}
\[5em]
begin{tabular}{ccc}
Column 1 & Column 2 & Column 3 \
second row & & \
third row & &
end{tabular}
&
begin{tabular}{lll}
toprule
Column 1 & Column 2 & Column 3 \
midrule
second row & & \
third row & & \
bottomrule
end{tabular}
\[5em]
% Colour for the rulings in tables:
makeatletter
defrulecolor#1#{CT@arc{#1}}
defCT@arc#1#2{%
ifdimbaselineskip=z@noalignfi
{gdefCT@arc@{color#1{#2}}}}
letCT@arc@relax
rulecolor{gray!50}
makeatother
begin{tabular}{@{}lll@{}}
toprule
Column 1 & Column 2 & Column 3 \
midrule
second row & & \
third row & & \
bottomrule
end{tabular}
end{tabular}
end{document}
add a comment |
up vote
5
down vote
There is the hhline
package and the arydshln
package. You can get colour in the table with the xcolor
package.
You might have your reasons to typeset your tables with many different line styles... I'd usually recommend to avoid vertical lines at all and to draw horizontal lines with commands provided by the booktabs
package.
In case you are writing something related to science, more or less all textbooks seem to roughly follow similar guidelines. Rarely you will find a vertical line.
add a comment |
up vote
0
down vote
You can use all the flexibility permitted by LaTeX:
usepackage{arydshln}
...
begin{table}[h]
begin{tabular}{lll}
multicolumn{1}{c}{textbf{Title 1}} & & multicolumn{1}{c}{textbf{Title 2}} \
cline{1-1} cline{3-3}
multicolumn{1}{|l|}{Cell 1} & & multicolumn{1}{|l|}{Cell 2} \
cdashline{3-3}
multicolumn{1}{|l|}{Cell 3} & & multicolumn{1}{|l|}{Cell 4} \
cline{3-3}
multicolumn{1}{|l|}{Cell 5} & & \
cline{1-1}
end{tabular}
end{table}
The result is:
Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format.
– Paul Gessler
Feb 17 '15 at 12:11
add a comment |
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
15
down vote
accepted
documentclass{article}
usepackage{array,booktabs,arydshln,xcolor}
newcommandVRule[1][arrayrulewidth]{vrule width #1}
begin{document}
begin{tabular}{!{VRule[2pt]}c!{VRule}c!{color{red}VRule[3pt]}c!{VRule}}
Column 1 & Column 2 & column3 \specialrule{3pt}{0pt}{0pt}
second row & & \hdashline
third row & & \specialrule{4pt}{0pt}{0pt}
end{tabular}
end{document}
I want to add a one bold horizontal line only between the two row... this method didn't work.
– Misaki
Oct 9 '13 at 10:18
1
Please explain how this works.
– Duncan Whyte
Mar 26 at 17:53
add a comment |
up vote
15
down vote
accepted
documentclass{article}
usepackage{array,booktabs,arydshln,xcolor}
newcommandVRule[1][arrayrulewidth]{vrule width #1}
begin{document}
begin{tabular}{!{VRule[2pt]}c!{VRule}c!{color{red}VRule[3pt]}c!{VRule}}
Column 1 & Column 2 & column3 \specialrule{3pt}{0pt}{0pt}
second row & & \hdashline
third row & & \specialrule{4pt}{0pt}{0pt}
end{tabular}
end{document}
I want to add a one bold horizontal line only between the two row... this method didn't work.
– Misaki
Oct 9 '13 at 10:18
1
Please explain how this works.
– Duncan Whyte
Mar 26 at 17:53
add a comment |
up vote
15
down vote
accepted
up vote
15
down vote
accepted
documentclass{article}
usepackage{array,booktabs,arydshln,xcolor}
newcommandVRule[1][arrayrulewidth]{vrule width #1}
begin{document}
begin{tabular}{!{VRule[2pt]}c!{VRule}c!{color{red}VRule[3pt]}c!{VRule}}
Column 1 & Column 2 & column3 \specialrule{3pt}{0pt}{0pt}
second row & & \hdashline
third row & & \specialrule{4pt}{0pt}{0pt}
end{tabular}
end{document}
documentclass{article}
usepackage{array,booktabs,arydshln,xcolor}
newcommandVRule[1][arrayrulewidth]{vrule width #1}
begin{document}
begin{tabular}{!{VRule[2pt]}c!{VRule}c!{color{red}VRule[3pt]}c!{VRule}}
Column 1 & Column 2 & column3 \specialrule{3pt}{0pt}{0pt}
second row & & \hdashline
third row & & \specialrule{4pt}{0pt}{0pt}
end{tabular}
end{document}
answered Feb 4 '11 at 15:46
Herbert
266k23405714
266k23405714
I want to add a one bold horizontal line only between the two row... this method didn't work.
– Misaki
Oct 9 '13 at 10:18
1
Please explain how this works.
– Duncan Whyte
Mar 26 at 17:53
add a comment |
I want to add a one bold horizontal line only between the two row... this method didn't work.
– Misaki
Oct 9 '13 at 10:18
1
Please explain how this works.
– Duncan Whyte
Mar 26 at 17:53
I want to add a one bold horizontal line only between the two row... this method didn't work.
– Misaki
Oct 9 '13 at 10:18
I want to add a one bold horizontal line only between the two row... this method didn't work.
– Misaki
Oct 9 '13 at 10:18
1
1
Please explain how this works.
– Duncan Whyte
Mar 26 at 17:53
Please explain how this works.
– Duncan Whyte
Mar 26 at 17:53
add a comment |
up vote
13
down vote
Here are a few table layouts, with my favourite one last.
documentclass{article}
usepackage{xcolor}
usepackage{booktabs}
begin{document}
begin{tabular}{p{6cm}p{6cm}}
begin{tabular}{|c|c|c|}
hline
Column 1 & Column 2 & Column 3 \
hline
second row & & \
hline
third row & & \
hline
end{tabular}
&
begin{tabular}{ccc}
Column 1 & Column 2 & Column 3 \
hline
second row & & \
hline
third row & & \
hline
end{tabular}
\[5em]
begin{tabular}{|ccc|}
hline
Column 1 & Column 2 & Column 3 \
hline
second row & & \
third row & & \
hline
end{tabular}
&
begin{tabular}{|c|c|c|}
hline
Column 1 & Column 2 & Column 3 \
hline
second row & & \
third row & & \
hline
end{tabular}
\[5em]
begin{tabular}{ccc}
Column 1 & Column 2 & Column 3 \
second row & & \
third row & &
end{tabular}
&
begin{tabular}{lll}
toprule
Column 1 & Column 2 & Column 3 \
midrule
second row & & \
third row & & \
bottomrule
end{tabular}
\[5em]
% Colour for the rulings in tables:
makeatletter
defrulecolor#1#{CT@arc{#1}}
defCT@arc#1#2{%
ifdimbaselineskip=z@noalignfi
{gdefCT@arc@{color#1{#2}}}}
letCT@arc@relax
rulecolor{gray!50}
makeatother
begin{tabular}{@{}lll@{}}
toprule
Column 1 & Column 2 & Column 3 \
midrule
second row & & \
third row & & \
bottomrule
end{tabular}
end{tabular}
end{document}
add a comment |
up vote
13
down vote
Here are a few table layouts, with my favourite one last.
documentclass{article}
usepackage{xcolor}
usepackage{booktabs}
begin{document}
begin{tabular}{p{6cm}p{6cm}}
begin{tabular}{|c|c|c|}
hline
Column 1 & Column 2 & Column 3 \
hline
second row & & \
hline
third row & & \
hline
end{tabular}
&
begin{tabular}{ccc}
Column 1 & Column 2 & Column 3 \
hline
second row & & \
hline
third row & & \
hline
end{tabular}
\[5em]
begin{tabular}{|ccc|}
hline
Column 1 & Column 2 & Column 3 \
hline
second row & & \
third row & & \
hline
end{tabular}
&
begin{tabular}{|c|c|c|}
hline
Column 1 & Column 2 & Column 3 \
hline
second row & & \
third row & & \
hline
end{tabular}
\[5em]
begin{tabular}{ccc}
Column 1 & Column 2 & Column 3 \
second row & & \
third row & &
end{tabular}
&
begin{tabular}{lll}
toprule
Column 1 & Column 2 & Column 3 \
midrule
second row & & \
third row & & \
bottomrule
end{tabular}
\[5em]
% Colour for the rulings in tables:
makeatletter
defrulecolor#1#{CT@arc{#1}}
defCT@arc#1#2{%
ifdimbaselineskip=z@noalignfi
{gdefCT@arc@{color#1{#2}}}}
letCT@arc@relax
rulecolor{gray!50}
makeatother
begin{tabular}{@{}lll@{}}
toprule
Column 1 & Column 2 & Column 3 \
midrule
second row & & \
third row & & \
bottomrule
end{tabular}
end{tabular}
end{document}
add a comment |
up vote
13
down vote
up vote
13
down vote
Here are a few table layouts, with my favourite one last.
documentclass{article}
usepackage{xcolor}
usepackage{booktabs}
begin{document}
begin{tabular}{p{6cm}p{6cm}}
begin{tabular}{|c|c|c|}
hline
Column 1 & Column 2 & Column 3 \
hline
second row & & \
hline
third row & & \
hline
end{tabular}
&
begin{tabular}{ccc}
Column 1 & Column 2 & Column 3 \
hline
second row & & \
hline
third row & & \
hline
end{tabular}
\[5em]
begin{tabular}{|ccc|}
hline
Column 1 & Column 2 & Column 3 \
hline
second row & & \
third row & & \
hline
end{tabular}
&
begin{tabular}{|c|c|c|}
hline
Column 1 & Column 2 & Column 3 \
hline
second row & & \
third row & & \
hline
end{tabular}
\[5em]
begin{tabular}{ccc}
Column 1 & Column 2 & Column 3 \
second row & & \
third row & &
end{tabular}
&
begin{tabular}{lll}
toprule
Column 1 & Column 2 & Column 3 \
midrule
second row & & \
third row & & \
bottomrule
end{tabular}
\[5em]
% Colour for the rulings in tables:
makeatletter
defrulecolor#1#{CT@arc{#1}}
defCT@arc#1#2{%
ifdimbaselineskip=z@noalignfi
{gdefCT@arc@{color#1{#2}}}}
letCT@arc@relax
rulecolor{gray!50}
makeatother
begin{tabular}{@{}lll@{}}
toprule
Column 1 & Column 2 & Column 3 \
midrule
second row & & \
third row & & \
bottomrule
end{tabular}
end{tabular}
end{document}
Here are a few table layouts, with my favourite one last.
documentclass{article}
usepackage{xcolor}
usepackage{booktabs}
begin{document}
begin{tabular}{p{6cm}p{6cm}}
begin{tabular}{|c|c|c|}
hline
Column 1 & Column 2 & Column 3 \
hline
second row & & \
hline
third row & & \
hline
end{tabular}
&
begin{tabular}{ccc}
Column 1 & Column 2 & Column 3 \
hline
second row & & \
hline
third row & & \
hline
end{tabular}
\[5em]
begin{tabular}{|ccc|}
hline
Column 1 & Column 2 & Column 3 \
hline
second row & & \
third row & & \
hline
end{tabular}
&
begin{tabular}{|c|c|c|}
hline
Column 1 & Column 2 & Column 3 \
hline
second row & & \
third row & & \
hline
end{tabular}
\[5em]
begin{tabular}{ccc}
Column 1 & Column 2 & Column 3 \
second row & & \
third row & &
end{tabular}
&
begin{tabular}{lll}
toprule
Column 1 & Column 2 & Column 3 \
midrule
second row & & \
third row & & \
bottomrule
end{tabular}
\[5em]
% Colour for the rulings in tables:
makeatletter
defrulecolor#1#{CT@arc{#1}}
defCT@arc#1#2{%
ifdimbaselineskip=z@noalignfi
{gdefCT@arc@{color#1{#2}}}}
letCT@arc@relax
rulecolor{gray!50}
makeatother
begin{tabular}{@{}lll@{}}
toprule
Column 1 & Column 2 & Column 3 \
midrule
second row & & \
third row & & \
bottomrule
end{tabular}
end{tabular}
end{document}
answered Feb 17 '15 at 17:01
Benjamin McKay
2,43411427
2,43411427
add a comment |
add a comment |
up vote
5
down vote
There is the hhline
package and the arydshln
package. You can get colour in the table with the xcolor
package.
You might have your reasons to typeset your tables with many different line styles... I'd usually recommend to avoid vertical lines at all and to draw horizontal lines with commands provided by the booktabs
package.
In case you are writing something related to science, more or less all textbooks seem to roughly follow similar guidelines. Rarely you will find a vertical line.
add a comment |
up vote
5
down vote
There is the hhline
package and the arydshln
package. You can get colour in the table with the xcolor
package.
You might have your reasons to typeset your tables with many different line styles... I'd usually recommend to avoid vertical lines at all and to draw horizontal lines with commands provided by the booktabs
package.
In case you are writing something related to science, more or less all textbooks seem to roughly follow similar guidelines. Rarely you will find a vertical line.
add a comment |
up vote
5
down vote
up vote
5
down vote
There is the hhline
package and the arydshln
package. You can get colour in the table with the xcolor
package.
You might have your reasons to typeset your tables with many different line styles... I'd usually recommend to avoid vertical lines at all and to draw horizontal lines with commands provided by the booktabs
package.
In case you are writing something related to science, more or less all textbooks seem to roughly follow similar guidelines. Rarely you will find a vertical line.
There is the hhline
package and the arydshln
package. You can get colour in the table with the xcolor
package.
You might have your reasons to typeset your tables with many different line styles... I'd usually recommend to avoid vertical lines at all and to draw horizontal lines with commands provided by the booktabs
package.
In case you are writing something related to science, more or less all textbooks seem to roughly follow similar guidelines. Rarely you will find a vertical line.
edited Feb 4 '11 at 16:37
Hendrik Vogt
28.6k4105188
28.6k4105188
answered Feb 4 '11 at 15:19
Martin H
13.7k24055
13.7k24055
add a comment |
add a comment |
up vote
0
down vote
You can use all the flexibility permitted by LaTeX:
usepackage{arydshln}
...
begin{table}[h]
begin{tabular}{lll}
multicolumn{1}{c}{textbf{Title 1}} & & multicolumn{1}{c}{textbf{Title 2}} \
cline{1-1} cline{3-3}
multicolumn{1}{|l|}{Cell 1} & & multicolumn{1}{|l|}{Cell 2} \
cdashline{3-3}
multicolumn{1}{|l|}{Cell 3} & & multicolumn{1}{|l|}{Cell 4} \
cline{3-3}
multicolumn{1}{|l|}{Cell 5} & & \
cline{1-1}
end{tabular}
end{table}
The result is:
Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format.
– Paul Gessler
Feb 17 '15 at 12:11
add a comment |
up vote
0
down vote
You can use all the flexibility permitted by LaTeX:
usepackage{arydshln}
...
begin{table}[h]
begin{tabular}{lll}
multicolumn{1}{c}{textbf{Title 1}} & & multicolumn{1}{c}{textbf{Title 2}} \
cline{1-1} cline{3-3}
multicolumn{1}{|l|}{Cell 1} & & multicolumn{1}{|l|}{Cell 2} \
cdashline{3-3}
multicolumn{1}{|l|}{Cell 3} & & multicolumn{1}{|l|}{Cell 4} \
cline{3-3}
multicolumn{1}{|l|}{Cell 5} & & \
cline{1-1}
end{tabular}
end{table}
The result is:
Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format.
– Paul Gessler
Feb 17 '15 at 12:11
add a comment |
up vote
0
down vote
up vote
0
down vote
You can use all the flexibility permitted by LaTeX:
usepackage{arydshln}
...
begin{table}[h]
begin{tabular}{lll}
multicolumn{1}{c}{textbf{Title 1}} & & multicolumn{1}{c}{textbf{Title 2}} \
cline{1-1} cline{3-3}
multicolumn{1}{|l|}{Cell 1} & & multicolumn{1}{|l|}{Cell 2} \
cdashline{3-3}
multicolumn{1}{|l|}{Cell 3} & & multicolumn{1}{|l|}{Cell 4} \
cline{3-3}
multicolumn{1}{|l|}{Cell 5} & & \
cline{1-1}
end{tabular}
end{table}
The result is:
You can use all the flexibility permitted by LaTeX:
usepackage{arydshln}
...
begin{table}[h]
begin{tabular}{lll}
multicolumn{1}{c}{textbf{Title 1}} & & multicolumn{1}{c}{textbf{Title 2}} \
cline{1-1} cline{3-3}
multicolumn{1}{|l|}{Cell 1} & & multicolumn{1}{|l|}{Cell 2} \
cdashline{3-3}
multicolumn{1}{|l|}{Cell 3} & & multicolumn{1}{|l|}{Cell 4} \
cline{3-3}
multicolumn{1}{|l|}{Cell 5} & & \
cline{1-1}
end{tabular}
end{table}
The result is:
answered Feb 17 '15 at 11:02
Simone Dagli Orti
1011
1011
Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format.
– Paul Gessler
Feb 17 '15 at 12:11
add a comment |
Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format.
– Paul Gessler
Feb 17 '15 at 12:11
Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format.
– Paul Gessler
Feb 17 '15 at 12:11
Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format.
– Paul Gessler
Feb 17 '15 at 12:11
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%2f10243%2ftabular-border-style%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
I wouldn´t like the look of dashed lines, even in illustrations, if you can use gray lines instead.
– Benjamin McKay
Feb 17 '15 at 16:46