how to draw a cayley table











up vote
2
down vote

favorite












I'm trying to make a Cayley table like the one in the following question, but I don't want the labels eg on top (Capacity) and on the left side (the w's and v's), I just would like to reproduce the exact same table without the 'extra' bits on the side.



I forgot to mention I want a 5x5 table (25 entries inside the table) but still with the "outer" headings.



EDIT: I managed to do this however this is long winded I think:



[
begin{tabular}{>{$}l<{$}|*{6}{>{$}l<{$}}}
~ & 1 & a & a^2 & a^3 & a^4 \
hlinevrule height 12pt width 0pt
1 & 1 & a & a^2 & a^3 & a^4 \
a & a & a^2 & a^3 & a^4 & a^5 \
a^2 & a^2 & a^3 & a^4 & a^5 & a^6 \
a^3 & a^3 & a^4 & a^5 & a^6 & a^7 \
a^4 & a^4 & a^5 & a^6 & a^7 & a^8 \
end{tabular}
]









share|improve this question









New contributor




A.E is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • the answer provided was excellent in the above link, I would appreciate if I can get a similar answer.
    – A.E
    39 mins ago






  • 3




    Just take Gonzalo's answer and delete first line (the one which contains Capacity) and two left columns and two right ones.
    – Ignasi
    28 mins ago










  • Welcome!! See this link: Tables (Overleaf) and then ask if you don't know how to do something.
    – manooooh
    26 mins ago










  • @A.E The question you link to was excellent and included a minimal working example (MWE). We would appreciate if you would ask a similar good question.
    – daniel
    17 mins ago






  • 1




    array, not tabular.
    – egreg
    12 mins ago















up vote
2
down vote

favorite












I'm trying to make a Cayley table like the one in the following question, but I don't want the labels eg on top (Capacity) and on the left side (the w's and v's), I just would like to reproduce the exact same table without the 'extra' bits on the side.



I forgot to mention I want a 5x5 table (25 entries inside the table) but still with the "outer" headings.



EDIT: I managed to do this however this is long winded I think:



[
begin{tabular}{>{$}l<{$}|*{6}{>{$}l<{$}}}
~ & 1 & a & a^2 & a^3 & a^4 \
hlinevrule height 12pt width 0pt
1 & 1 & a & a^2 & a^3 & a^4 \
a & a & a^2 & a^3 & a^4 & a^5 \
a^2 & a^2 & a^3 & a^4 & a^5 & a^6 \
a^3 & a^3 & a^4 & a^5 & a^6 & a^7 \
a^4 & a^4 & a^5 & a^6 & a^7 & a^8 \
end{tabular}
]









share|improve this question









New contributor




A.E is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • the answer provided was excellent in the above link, I would appreciate if I can get a similar answer.
    – A.E
    39 mins ago






  • 3




    Just take Gonzalo's answer and delete first line (the one which contains Capacity) and two left columns and two right ones.
    – Ignasi
    28 mins ago










  • Welcome!! See this link: Tables (Overleaf) and then ask if you don't know how to do something.
    – manooooh
    26 mins ago










  • @A.E The question you link to was excellent and included a minimal working example (MWE). We would appreciate if you would ask a similar good question.
    – daniel
    17 mins ago






  • 1




    array, not tabular.
    – egreg
    12 mins ago













up vote
2
down vote

favorite









up vote
2
down vote

favorite











I'm trying to make a Cayley table like the one in the following question, but I don't want the labels eg on top (Capacity) and on the left side (the w's and v's), I just would like to reproduce the exact same table without the 'extra' bits on the side.



I forgot to mention I want a 5x5 table (25 entries inside the table) but still with the "outer" headings.



EDIT: I managed to do this however this is long winded I think:



[
begin{tabular}{>{$}l<{$}|*{6}{>{$}l<{$}}}
~ & 1 & a & a^2 & a^3 & a^4 \
hlinevrule height 12pt width 0pt
1 & 1 & a & a^2 & a^3 & a^4 \
a & a & a^2 & a^3 & a^4 & a^5 \
a^2 & a^2 & a^3 & a^4 & a^5 & a^6 \
a^3 & a^3 & a^4 & a^5 & a^6 & a^7 \
a^4 & a^4 & a^5 & a^6 & a^7 & a^8 \
end{tabular}
]









share|improve this question









New contributor




A.E is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











I'm trying to make a Cayley table like the one in the following question, but I don't want the labels eg on top (Capacity) and on the left side (the w's and v's), I just would like to reproduce the exact same table without the 'extra' bits on the side.



I forgot to mention I want a 5x5 table (25 entries inside the table) but still with the "outer" headings.



EDIT: I managed to do this however this is long winded I think:



[
begin{tabular}{>{$}l<{$}|*{6}{>{$}l<{$}}}
~ & 1 & a & a^2 & a^3 & a^4 \
hlinevrule height 12pt width 0pt
1 & 1 & a & a^2 & a^3 & a^4 \
a & a & a^2 & a^3 & a^4 & a^5 \
a^2 & a^2 & a^3 & a^4 & a^5 & a^6 \
a^3 & a^3 & a^4 & a^5 & a^6 & a^7 \
a^4 & a^4 & a^5 & a^6 & a^7 & a^8 \
end{tabular}
]






tables






share|improve this question









New contributor




A.E is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




A.E is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 10 mins ago









GiuTeX

528216




528216






New contributor




A.E is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 46 mins ago









A.E

204




204




New contributor




A.E is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





A.E is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






A.E is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












  • the answer provided was excellent in the above link, I would appreciate if I can get a similar answer.
    – A.E
    39 mins ago






  • 3




    Just take Gonzalo's answer and delete first line (the one which contains Capacity) and two left columns and two right ones.
    – Ignasi
    28 mins ago










  • Welcome!! See this link: Tables (Overleaf) and then ask if you don't know how to do something.
    – manooooh
    26 mins ago










  • @A.E The question you link to was excellent and included a minimal working example (MWE). We would appreciate if you would ask a similar good question.
    – daniel
    17 mins ago






  • 1




    array, not tabular.
    – egreg
    12 mins ago


















  • the answer provided was excellent in the above link, I would appreciate if I can get a similar answer.
    – A.E
    39 mins ago






  • 3




    Just take Gonzalo's answer and delete first line (the one which contains Capacity) and two left columns and two right ones.
    – Ignasi
    28 mins ago










  • Welcome!! See this link: Tables (Overleaf) and then ask if you don't know how to do something.
    – manooooh
    26 mins ago










  • @A.E The question you link to was excellent and included a minimal working example (MWE). We would appreciate if you would ask a similar good question.
    – daniel
    17 mins ago






  • 1




    array, not tabular.
    – egreg
    12 mins ago
















the answer provided was excellent in the above link, I would appreciate if I can get a similar answer.
– A.E
39 mins ago




the answer provided was excellent in the above link, I would appreciate if I can get a similar answer.
– A.E
39 mins ago




3




3




Just take Gonzalo's answer and delete first line (the one which contains Capacity) and two left columns and two right ones.
– Ignasi
28 mins ago




Just take Gonzalo's answer and delete first line (the one which contains Capacity) and two left columns and two right ones.
– Ignasi
28 mins ago












Welcome!! See this link: Tables (Overleaf) and then ask if you don't know how to do something.
– manooooh
26 mins ago




Welcome!! See this link: Tables (Overleaf) and then ask if you don't know how to do something.
– manooooh
26 mins ago












@A.E The question you link to was excellent and included a minimal working example (MWE). We would appreciate if you would ask a similar good question.
– daniel
17 mins ago




@A.E The question you link to was excellent and included a minimal working example (MWE). We would appreciate if you would ask a similar good question.
– daniel
17 mins ago




1




1




array, not tabular.
– egreg
12 mins ago




array, not tabular.
– egreg
12 mins ago










2 Answers
2






active

oldest

votes

















up vote
1
down vote



accepted










Basically I've just taken the answer to the question you linked and changed few lines to adapt to your needs.



Here's the code, followed by the output you will get and a brief explanation of what's going on.



documentclass[10pt]{article}
usepackage{array}

begin{document}

setlengthextrarowheight{3pt}
begin{tabular}{c | c c c c c}

$i$ & 0 & 1 & 2 & 3 & 4 \
cline{1-6}
0 & 0 & 0 & 0 & 0 & 0 \
1 & 0 & 0 & 0 & 25 & 25 \
2 & 0 & 0 & 20 & 25 & 25 \
2 & 0 & 0 & 20 & 25 & 25 \
2 & 0 & 0 & 20 & 25 & 25 \
end{tabular}

end{document}


Result



How does it work? A table is done with the environment {tabular}, which requires as argument the numer of columns (or rows... just read the documentation to know more) which is specified by the argument {c | c c c c c}: 6 columns divided by a line between the first and the second col. The 'c' stands for centered meaning that the column will be aligned to the center, if you want you can change it to l (left) or r (right).



Then in the tables all the entries are done by spacing them with &, and the cline takes as argument the number of columns that you want it to span: from column 1 to column 6.



The command setlengthextrarowheight{3pt} adds some extra row height (how surprising!).



Package {array} is needed for the length extrarowheight.






share|improve this answer



















  • 1




    this is good however I wanted a 5x5 table
    – A.E
    15 mins ago






  • 1




    Cheers pal, much appreciated.
    – A.E
    14 mins ago






  • 1




    if you could briefly explain what you did line by line, It would be more beneficial so I know what you've done
    – A.E
    12 mins ago






  • 1




    much appreciated
    – A.E
    5 mins ago










  • I added more on the meaning of the c's in {tabular} environment.
    – GiuTeX
    4 mins ago


















up vote
0
down vote













Your input is almost good, but you can do better.



documentclass{article}
usepackage{amsmath}
usepackage{array}

begin{document}

This is a Cayley table
[
begin{array}{l|*{6}{l}}
& 1 & a & a^2 & a^3 & a^4 \
hline
1 & 1 & a & a^2 & a^3 & a^4 \
a & a & a^2 & a^3 & a^4 & a^5 \
a^2 & a^2 & a^3 & a^4 & a^5 & a^6 \
a^3 & a^3 & a^4 & a^5 & a^6 & a^7 \
a^4 & a^4 & a^5 & a^6 & a^7 & a^8 \
end{array}
]

This is the same, but with some more spacing,
[
setlength{extrarowheight}{3pt}% local setting
begin{array}{l|*{6}{l}}
& 1 & a & a^2 & a^3 & a^4 \
hline
1 & 1 & a & a^2 & a^3 & a^4 \
a & a & a^2 & a^3 & a^4 & a^5 \
a^2 & a^2 & a^3 & a^4 & a^5 & a^6 \
a^3 & a^3 & a^4 & a^5 & a^6 & a^7 \
a^4 & a^4 & a^5 & a^6 & a^7 & a^8 \
end{array}
]

end{document}


With array, each cell is assumed to be in math mode. The setting of extrarowheight will not propagate to other instances of array, because [...] forms a group.



enter image description here





share





















  • I prefer the method above as it is easier to follow(in my eyes anyway) but thanks for you answer
    – A.E
    6 secs ago











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


}
});






A.E is a new contributor. Be nice, and check out our Code of Conduct.










 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f459639%2fhow-to-draw-a-cayley-table%23new-answer', 'question_page');
}
);

Post as a guest
































2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
1
down vote



accepted










Basically I've just taken the answer to the question you linked and changed few lines to adapt to your needs.



Here's the code, followed by the output you will get and a brief explanation of what's going on.



documentclass[10pt]{article}
usepackage{array}

begin{document}

setlengthextrarowheight{3pt}
begin{tabular}{c | c c c c c}

$i$ & 0 & 1 & 2 & 3 & 4 \
cline{1-6}
0 & 0 & 0 & 0 & 0 & 0 \
1 & 0 & 0 & 0 & 25 & 25 \
2 & 0 & 0 & 20 & 25 & 25 \
2 & 0 & 0 & 20 & 25 & 25 \
2 & 0 & 0 & 20 & 25 & 25 \
end{tabular}

end{document}


Result



How does it work? A table is done with the environment {tabular}, which requires as argument the numer of columns (or rows... just read the documentation to know more) which is specified by the argument {c | c c c c c}: 6 columns divided by a line between the first and the second col. The 'c' stands for centered meaning that the column will be aligned to the center, if you want you can change it to l (left) or r (right).



Then in the tables all the entries are done by spacing them with &, and the cline takes as argument the number of columns that you want it to span: from column 1 to column 6.



The command setlengthextrarowheight{3pt} adds some extra row height (how surprising!).



Package {array} is needed for the length extrarowheight.






share|improve this answer



















  • 1




    this is good however I wanted a 5x5 table
    – A.E
    15 mins ago






  • 1




    Cheers pal, much appreciated.
    – A.E
    14 mins ago






  • 1




    if you could briefly explain what you did line by line, It would be more beneficial so I know what you've done
    – A.E
    12 mins ago






  • 1




    much appreciated
    – A.E
    5 mins ago










  • I added more on the meaning of the c's in {tabular} environment.
    – GiuTeX
    4 mins ago















up vote
1
down vote



accepted










Basically I've just taken the answer to the question you linked and changed few lines to adapt to your needs.



Here's the code, followed by the output you will get and a brief explanation of what's going on.



documentclass[10pt]{article}
usepackage{array}

begin{document}

setlengthextrarowheight{3pt}
begin{tabular}{c | c c c c c}

$i$ & 0 & 1 & 2 & 3 & 4 \
cline{1-6}
0 & 0 & 0 & 0 & 0 & 0 \
1 & 0 & 0 & 0 & 25 & 25 \
2 & 0 & 0 & 20 & 25 & 25 \
2 & 0 & 0 & 20 & 25 & 25 \
2 & 0 & 0 & 20 & 25 & 25 \
end{tabular}

end{document}


Result



How does it work? A table is done with the environment {tabular}, which requires as argument the numer of columns (or rows... just read the documentation to know more) which is specified by the argument {c | c c c c c}: 6 columns divided by a line between the first and the second col. The 'c' stands for centered meaning that the column will be aligned to the center, if you want you can change it to l (left) or r (right).



Then in the tables all the entries are done by spacing them with &, and the cline takes as argument the number of columns that you want it to span: from column 1 to column 6.



The command setlengthextrarowheight{3pt} adds some extra row height (how surprising!).



Package {array} is needed for the length extrarowheight.






share|improve this answer



















  • 1




    this is good however I wanted a 5x5 table
    – A.E
    15 mins ago






  • 1




    Cheers pal, much appreciated.
    – A.E
    14 mins ago






  • 1




    if you could briefly explain what you did line by line, It would be more beneficial so I know what you've done
    – A.E
    12 mins ago






  • 1




    much appreciated
    – A.E
    5 mins ago










  • I added more on the meaning of the c's in {tabular} environment.
    – GiuTeX
    4 mins ago













up vote
1
down vote



accepted







up vote
1
down vote



accepted






Basically I've just taken the answer to the question you linked and changed few lines to adapt to your needs.



Here's the code, followed by the output you will get and a brief explanation of what's going on.



documentclass[10pt]{article}
usepackage{array}

begin{document}

setlengthextrarowheight{3pt}
begin{tabular}{c | c c c c c}

$i$ & 0 & 1 & 2 & 3 & 4 \
cline{1-6}
0 & 0 & 0 & 0 & 0 & 0 \
1 & 0 & 0 & 0 & 25 & 25 \
2 & 0 & 0 & 20 & 25 & 25 \
2 & 0 & 0 & 20 & 25 & 25 \
2 & 0 & 0 & 20 & 25 & 25 \
end{tabular}

end{document}


Result



How does it work? A table is done with the environment {tabular}, which requires as argument the numer of columns (or rows... just read the documentation to know more) which is specified by the argument {c | c c c c c}: 6 columns divided by a line between the first and the second col. The 'c' stands for centered meaning that the column will be aligned to the center, if you want you can change it to l (left) or r (right).



Then in the tables all the entries are done by spacing them with &, and the cline takes as argument the number of columns that you want it to span: from column 1 to column 6.



The command setlengthextrarowheight{3pt} adds some extra row height (how surprising!).



Package {array} is needed for the length extrarowheight.






share|improve this answer














Basically I've just taken the answer to the question you linked and changed few lines to adapt to your needs.



Here's the code, followed by the output you will get and a brief explanation of what's going on.



documentclass[10pt]{article}
usepackage{array}

begin{document}

setlengthextrarowheight{3pt}
begin{tabular}{c | c c c c c}

$i$ & 0 & 1 & 2 & 3 & 4 \
cline{1-6}
0 & 0 & 0 & 0 & 0 & 0 \
1 & 0 & 0 & 0 & 25 & 25 \
2 & 0 & 0 & 20 & 25 & 25 \
2 & 0 & 0 & 20 & 25 & 25 \
2 & 0 & 0 & 20 & 25 & 25 \
end{tabular}

end{document}


Result



How does it work? A table is done with the environment {tabular}, which requires as argument the numer of columns (or rows... just read the documentation to know more) which is specified by the argument {c | c c c c c}: 6 columns divided by a line between the first and the second col. The 'c' stands for centered meaning that the column will be aligned to the center, if you want you can change it to l (left) or r (right).



Then in the tables all the entries are done by spacing them with &, and the cline takes as argument the number of columns that you want it to span: from column 1 to column 6.



The command setlengthextrarowheight{3pt} adds some extra row height (how surprising!).



Package {array} is needed for the length extrarowheight.







share|improve this answer














share|improve this answer



share|improve this answer








edited 41 secs ago

























answered 18 mins ago









GiuTeX

528216




528216








  • 1




    this is good however I wanted a 5x5 table
    – A.E
    15 mins ago






  • 1




    Cheers pal, much appreciated.
    – A.E
    14 mins ago






  • 1




    if you could briefly explain what you did line by line, It would be more beneficial so I know what you've done
    – A.E
    12 mins ago






  • 1




    much appreciated
    – A.E
    5 mins ago










  • I added more on the meaning of the c's in {tabular} environment.
    – GiuTeX
    4 mins ago














  • 1




    this is good however I wanted a 5x5 table
    – A.E
    15 mins ago






  • 1




    Cheers pal, much appreciated.
    – A.E
    14 mins ago






  • 1




    if you could briefly explain what you did line by line, It would be more beneficial so I know what you've done
    – A.E
    12 mins ago






  • 1




    much appreciated
    – A.E
    5 mins ago










  • I added more on the meaning of the c's in {tabular} environment.
    – GiuTeX
    4 mins ago








1




1




this is good however I wanted a 5x5 table
– A.E
15 mins ago




this is good however I wanted a 5x5 table
– A.E
15 mins ago




1




1




Cheers pal, much appreciated.
– A.E
14 mins ago




Cheers pal, much appreciated.
– A.E
14 mins ago




1




1




if you could briefly explain what you did line by line, It would be more beneficial so I know what you've done
– A.E
12 mins ago




if you could briefly explain what you did line by line, It would be more beneficial so I know what you've done
– A.E
12 mins ago




1




1




much appreciated
– A.E
5 mins ago




much appreciated
– A.E
5 mins ago












I added more on the meaning of the c's in {tabular} environment.
– GiuTeX
4 mins ago




I added more on the meaning of the c's in {tabular} environment.
– GiuTeX
4 mins ago










up vote
0
down vote













Your input is almost good, but you can do better.



documentclass{article}
usepackage{amsmath}
usepackage{array}

begin{document}

This is a Cayley table
[
begin{array}{l|*{6}{l}}
& 1 & a & a^2 & a^3 & a^4 \
hline
1 & 1 & a & a^2 & a^3 & a^4 \
a & a & a^2 & a^3 & a^4 & a^5 \
a^2 & a^2 & a^3 & a^4 & a^5 & a^6 \
a^3 & a^3 & a^4 & a^5 & a^6 & a^7 \
a^4 & a^4 & a^5 & a^6 & a^7 & a^8 \
end{array}
]

This is the same, but with some more spacing,
[
setlength{extrarowheight}{3pt}% local setting
begin{array}{l|*{6}{l}}
& 1 & a & a^2 & a^3 & a^4 \
hline
1 & 1 & a & a^2 & a^3 & a^4 \
a & a & a^2 & a^3 & a^4 & a^5 \
a^2 & a^2 & a^3 & a^4 & a^5 & a^6 \
a^3 & a^3 & a^4 & a^5 & a^6 & a^7 \
a^4 & a^4 & a^5 & a^6 & a^7 & a^8 \
end{array}
]

end{document}


With array, each cell is assumed to be in math mode. The setting of extrarowheight will not propagate to other instances of array, because [...] forms a group.



enter image description here





share





















  • I prefer the method above as it is easier to follow(in my eyes anyway) but thanks for you answer
    – A.E
    6 secs ago















up vote
0
down vote













Your input is almost good, but you can do better.



documentclass{article}
usepackage{amsmath}
usepackage{array}

begin{document}

This is a Cayley table
[
begin{array}{l|*{6}{l}}
& 1 & a & a^2 & a^3 & a^4 \
hline
1 & 1 & a & a^2 & a^3 & a^4 \
a & a & a^2 & a^3 & a^4 & a^5 \
a^2 & a^2 & a^3 & a^4 & a^5 & a^6 \
a^3 & a^3 & a^4 & a^5 & a^6 & a^7 \
a^4 & a^4 & a^5 & a^6 & a^7 & a^8 \
end{array}
]

This is the same, but with some more spacing,
[
setlength{extrarowheight}{3pt}% local setting
begin{array}{l|*{6}{l}}
& 1 & a & a^2 & a^3 & a^4 \
hline
1 & 1 & a & a^2 & a^3 & a^4 \
a & a & a^2 & a^3 & a^4 & a^5 \
a^2 & a^2 & a^3 & a^4 & a^5 & a^6 \
a^3 & a^3 & a^4 & a^5 & a^6 & a^7 \
a^4 & a^4 & a^5 & a^6 & a^7 & a^8 \
end{array}
]

end{document}


With array, each cell is assumed to be in math mode. The setting of extrarowheight will not propagate to other instances of array, because [...] forms a group.



enter image description here





share





















  • I prefer the method above as it is easier to follow(in my eyes anyway) but thanks for you answer
    – A.E
    6 secs ago













up vote
0
down vote










up vote
0
down vote









Your input is almost good, but you can do better.



documentclass{article}
usepackage{amsmath}
usepackage{array}

begin{document}

This is a Cayley table
[
begin{array}{l|*{6}{l}}
& 1 & a & a^2 & a^3 & a^4 \
hline
1 & 1 & a & a^2 & a^3 & a^4 \
a & a & a^2 & a^3 & a^4 & a^5 \
a^2 & a^2 & a^3 & a^4 & a^5 & a^6 \
a^3 & a^3 & a^4 & a^5 & a^6 & a^7 \
a^4 & a^4 & a^5 & a^6 & a^7 & a^8 \
end{array}
]

This is the same, but with some more spacing,
[
setlength{extrarowheight}{3pt}% local setting
begin{array}{l|*{6}{l}}
& 1 & a & a^2 & a^3 & a^4 \
hline
1 & 1 & a & a^2 & a^3 & a^4 \
a & a & a^2 & a^3 & a^4 & a^5 \
a^2 & a^2 & a^3 & a^4 & a^5 & a^6 \
a^3 & a^3 & a^4 & a^5 & a^6 & a^7 \
a^4 & a^4 & a^5 & a^6 & a^7 & a^8 \
end{array}
]

end{document}


With array, each cell is assumed to be in math mode. The setting of extrarowheight will not propagate to other instances of array, because [...] forms a group.



enter image description here





share












Your input is almost good, but you can do better.



documentclass{article}
usepackage{amsmath}
usepackage{array}

begin{document}

This is a Cayley table
[
begin{array}{l|*{6}{l}}
& 1 & a & a^2 & a^3 & a^4 \
hline
1 & 1 & a & a^2 & a^3 & a^4 \
a & a & a^2 & a^3 & a^4 & a^5 \
a^2 & a^2 & a^3 & a^4 & a^5 & a^6 \
a^3 & a^3 & a^4 & a^5 & a^6 & a^7 \
a^4 & a^4 & a^5 & a^6 & a^7 & a^8 \
end{array}
]

This is the same, but with some more spacing,
[
setlength{extrarowheight}{3pt}% local setting
begin{array}{l|*{6}{l}}
& 1 & a & a^2 & a^3 & a^4 \
hline
1 & 1 & a & a^2 & a^3 & a^4 \
a & a & a^2 & a^3 & a^4 & a^5 \
a^2 & a^2 & a^3 & a^4 & a^5 & a^6 \
a^3 & a^3 & a^4 & a^5 & a^6 & a^7 \
a^4 & a^4 & a^5 & a^6 & a^7 & a^8 \
end{array}
]

end{document}


With array, each cell is assumed to be in math mode. The setting of extrarowheight will not propagate to other instances of array, because [...] forms a group.



enter image description here






share











share


share










answered 1 min ago









egreg

696k8518483111




696k8518483111












  • I prefer the method above as it is easier to follow(in my eyes anyway) but thanks for you answer
    – A.E
    6 secs ago


















  • I prefer the method above as it is easier to follow(in my eyes anyway) but thanks for you answer
    – A.E
    6 secs ago
















I prefer the method above as it is easier to follow(in my eyes anyway) but thanks for you answer
– A.E
6 secs ago




I prefer the method above as it is easier to follow(in my eyes anyway) but thanks for you answer
– A.E
6 secs ago










A.E is a new contributor. Be nice, and check out our Code of Conduct.










 

draft saved


draft discarded


















A.E is a new contributor. Be nice, and check out our Code of Conduct.













A.E is a new contributor. Be nice, and check out our Code of Conduct.












A.E is a new contributor. Be nice, and check out our Code of Conduct.















 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f459639%2fhow-to-draw-a-cayley-table%23new-answer', 'question_page');
}
);

Post as a guest




















































































Popular posts from this blog

How to send String Array data to Server using php in android

Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

Is anime1.com a legal site for watching anime?