How do I make table cells that span more than one column or row?
I tried this code but the border lines are not deleted:
begin{tabular}{|p{0.6in}|p{0.3in}|p{0.9in}|p{0.9in}|p{0.8in}|} hline
& & & $P_{mot}$ & \ hline
$P_{batt}$ & & S & M & H \ hline
& S & S & Z & VS \ hline
SOC & M & M & Z & H \ hline
& H & M & Z & H \ hline
end{tabular}
How do I delete the border of cells?
tables multicolumn
add a comment |
I tried this code but the border lines are not deleted:
begin{tabular}{|p{0.6in}|p{0.3in}|p{0.9in}|p{0.9in}|p{0.8in}|} hline
& & & $P_{mot}$ & \ hline
$P_{batt}$ & & S & M & H \ hline
& S & S & Z & VS \ hline
SOC & M & M & Z & H \ hline
& H & M & Z & H \ hline
end{tabular}
How do I delete the border of cells?
tables multicolumn
5
Why not use a different (better) representation? Something that usesbooktabs
. Something like this?
– Werner
Nov 20 '18 at 6:17
2
You might have a use for tablesgenerator.com to generate your latex tables, I often use this tool.
– Maxim
Nov 20 '18 at 9:19
1
Welcome to TeX.SX! Please make your code compilable (if possible), or at least complete it withdocumentclass{...}
, the requiredusepackage
's,begin{document}
, andend{document}
. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem.
– Martin Schröder
Nov 20 '18 at 12:34
Okay i will consider those methods
– sreeramp96
Dec 1 '18 at 1:12
add a comment |
I tried this code but the border lines are not deleted:
begin{tabular}{|p{0.6in}|p{0.3in}|p{0.9in}|p{0.9in}|p{0.8in}|} hline
& & & $P_{mot}$ & \ hline
$P_{batt}$ & & S & M & H \ hline
& S & S & Z & VS \ hline
SOC & M & M & Z & H \ hline
& H & M & Z & H \ hline
end{tabular}
How do I delete the border of cells?
tables multicolumn
I tried this code but the border lines are not deleted:
begin{tabular}{|p{0.6in}|p{0.3in}|p{0.9in}|p{0.9in}|p{0.8in}|} hline
& & & $P_{mot}$ & \ hline
$P_{batt}$ & & S & M & H \ hline
& S & S & Z & VS \ hline
SOC & M & M & Z & H \ hline
& H & M & Z & H \ hline
end{tabular}
How do I delete the border of cells?
tables multicolumn
tables multicolumn
edited Nov 21 '18 at 13:02
asked Nov 20 '18 at 5:54
sreeramp96
196
196
5
Why not use a different (better) representation? Something that usesbooktabs
. Something like this?
– Werner
Nov 20 '18 at 6:17
2
You might have a use for tablesgenerator.com to generate your latex tables, I often use this tool.
– Maxim
Nov 20 '18 at 9:19
1
Welcome to TeX.SX! Please make your code compilable (if possible), or at least complete it withdocumentclass{...}
, the requiredusepackage
's,begin{document}
, andend{document}
. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem.
– Martin Schröder
Nov 20 '18 at 12:34
Okay i will consider those methods
– sreeramp96
Dec 1 '18 at 1:12
add a comment |
5
Why not use a different (better) representation? Something that usesbooktabs
. Something like this?
– Werner
Nov 20 '18 at 6:17
2
You might have a use for tablesgenerator.com to generate your latex tables, I often use this tool.
– Maxim
Nov 20 '18 at 9:19
1
Welcome to TeX.SX! Please make your code compilable (if possible), or at least complete it withdocumentclass{...}
, the requiredusepackage
's,begin{document}
, andend{document}
. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem.
– Martin Schröder
Nov 20 '18 at 12:34
Okay i will consider those methods
– sreeramp96
Dec 1 '18 at 1:12
5
5
Why not use a different (better) representation? Something that uses
booktabs
. Something like this?– Werner
Nov 20 '18 at 6:17
Why not use a different (better) representation? Something that uses
booktabs
. Something like this?– Werner
Nov 20 '18 at 6:17
2
2
You might have a use for tablesgenerator.com to generate your latex tables, I often use this tool.
– Maxim
Nov 20 '18 at 9:19
You might have a use for tablesgenerator.com to generate your latex tables, I often use this tool.
– Maxim
Nov 20 '18 at 9:19
1
1
Welcome to TeX.SX! Please make your code compilable (if possible), or at least complete it with
documentclass{...}
, the required usepackage
's, begin{document}
, and end{document}
. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem.– Martin Schröder
Nov 20 '18 at 12:34
Welcome to TeX.SX! Please make your code compilable (if possible), or at least complete it with
documentclass{...}
, the required usepackage
's, begin{document}
, and end{document}
. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem.– Martin Schröder
Nov 20 '18 at 12:34
Okay i will consider those methods
– sreeramp96
Dec 1 '18 at 1:12
Okay i will consider those methods
– sreeramp96
Dec 1 '18 at 1:12
add a comment |
3 Answers
3
active
oldest
votes
With multirow
and multicolumn
you can reach what you need.
I have also created a new column type for centering the cell contents and redefined arraystretch
to have more vertical space between rows.
However, I would suggest you to get rid of the vertical rules and use booktabs
.
documentclass{article}
usepackage{array}
newcolumntype{C}[1]{>{centeringarraybackslash}p{#1}}
renewcommand{arraystretch}{1.3}
usepackage{multirow}
usepackage{booktabs}
begin{document}
Your table:vspace{10pt}
begin{tabular}{|p{0.6in}|C{0.3in}|C{0.4in}|C{0.4in}|C{0.4in}|} hline
multicolumn{2}{|c|}{multirow{2}{*}{$P_{batt}$}}& multicolumn{3}{c|}{$P_{mot}$} \ cline{3-5}
multicolumn{2}{|c|}{} & S & M & H \ hline
& S & S & Z & VS \ cline{2-5}
SOC & M & M & Z & H \ cline{2-5}
& H & M & Z & H \ hline
end{tabular}
vspace{10pt}My suggestion:vspace{10pt}
begin{tabular}{lc*{3}{C{1.5em}}}
toprule
multicolumn{2}{c}{multirow{2}{*}{$P_{batt}$}}& multicolumn{3}{c}{$P_{mot}$} \ cmidrule{3-5}
multicolumn{2}{c}{} & S & M & H \ midrule
& S & S & Z & VS \ cmidrule(l){2-5}
SOC & M & M & Z & H \ cmidrule(l){2-5}
& H & M & Z & H \
bottomrule
end{tabular}
end{document}
Am a beginner in latex, that's why. I don;t know about this booktabs. Anyway thanks for the suggestion, I will look through it.
– sreeramp96
Nov 20 '18 at 7:27
add a comment |
Welcome to TeX.SE! In order to merge rows or columns, you need to use multirow
(which requires the multirow
package) or multicolumn
, respectively. And if you nest them, you need to do it in the right order.
documentclass{article}
usepackage{multirow}
begin{document}
begin{tabular}{|p{0.6in}|p{0.3in}|p{0.9in}|p{0.9in}|p{0.8in}|} hline
multicolumn{2}{|c|}{multirow{2}{*}{$P_mathrm{batt}$}} &
multicolumn{3}{|c|}{$P_mathrm{mot}$ } \ cline{3-5}
multicolumn{2}{|c|}{} & S & M & H \ cline{1-5}
multirow{3}{*}{SOC} & S & S & Z & VS \ cline{2-5}
& M & M & Z & H \ cline{2-5}
& H & M & Z & H \ hline
end{tabular}
end{document}
1
The initial|
inmulticolumn{3}{|c|}{$P_mathrm{mot}$ }
should be deleted, otherwise it is printed twice.
– CarLaTeX
Nov 20 '18 at 6:47
Yeah am not aware of all the methods. Thanks for the solution.
– sreeramp96
Nov 20 '18 at 7:29
add a comment |
Whatever applies to each item in a column should go in the column header. Here's my proposal:
documentclass[twocolumn]{article}
usepackage{array,booktabs}
usepackage{lipsum} % for context
begin{document}
lipsum[2]
begin{table}[htp]
centering
begin{tabular}{ @{} *{4}{w{c}{3em}} @{} }
toprule
$P_{mathrm{batt}}$ & multicolumn{3}{c}{$P_{mathrm{mot}}$} \
cmidrule(r){1-1} cmidrule(l){2-4}
SOC & S & M & H \
midrule
S & S & Z & VS \
M & M & Z & H \
H & M & Z & H \
bottomrule
end{tabular}
caption{Rule based of fuzzy logic control}
end{table}
lipsum
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/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%2f460878%2fhow-do-i-make-table-cells-that-span-more-than-one-column-or-row%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
With multirow
and multicolumn
you can reach what you need.
I have also created a new column type for centering the cell contents and redefined arraystretch
to have more vertical space between rows.
However, I would suggest you to get rid of the vertical rules and use booktabs
.
documentclass{article}
usepackage{array}
newcolumntype{C}[1]{>{centeringarraybackslash}p{#1}}
renewcommand{arraystretch}{1.3}
usepackage{multirow}
usepackage{booktabs}
begin{document}
Your table:vspace{10pt}
begin{tabular}{|p{0.6in}|C{0.3in}|C{0.4in}|C{0.4in}|C{0.4in}|} hline
multicolumn{2}{|c|}{multirow{2}{*}{$P_{batt}$}}& multicolumn{3}{c|}{$P_{mot}$} \ cline{3-5}
multicolumn{2}{|c|}{} & S & M & H \ hline
& S & S & Z & VS \ cline{2-5}
SOC & M & M & Z & H \ cline{2-5}
& H & M & Z & H \ hline
end{tabular}
vspace{10pt}My suggestion:vspace{10pt}
begin{tabular}{lc*{3}{C{1.5em}}}
toprule
multicolumn{2}{c}{multirow{2}{*}{$P_{batt}$}}& multicolumn{3}{c}{$P_{mot}$} \ cmidrule{3-5}
multicolumn{2}{c}{} & S & M & H \ midrule
& S & S & Z & VS \ cmidrule(l){2-5}
SOC & M & M & Z & H \ cmidrule(l){2-5}
& H & M & Z & H \
bottomrule
end{tabular}
end{document}
Am a beginner in latex, that's why. I don;t know about this booktabs. Anyway thanks for the suggestion, I will look through it.
– sreeramp96
Nov 20 '18 at 7:27
add a comment |
With multirow
and multicolumn
you can reach what you need.
I have also created a new column type for centering the cell contents and redefined arraystretch
to have more vertical space between rows.
However, I would suggest you to get rid of the vertical rules and use booktabs
.
documentclass{article}
usepackage{array}
newcolumntype{C}[1]{>{centeringarraybackslash}p{#1}}
renewcommand{arraystretch}{1.3}
usepackage{multirow}
usepackage{booktabs}
begin{document}
Your table:vspace{10pt}
begin{tabular}{|p{0.6in}|C{0.3in}|C{0.4in}|C{0.4in}|C{0.4in}|} hline
multicolumn{2}{|c|}{multirow{2}{*}{$P_{batt}$}}& multicolumn{3}{c|}{$P_{mot}$} \ cline{3-5}
multicolumn{2}{|c|}{} & S & M & H \ hline
& S & S & Z & VS \ cline{2-5}
SOC & M & M & Z & H \ cline{2-5}
& H & M & Z & H \ hline
end{tabular}
vspace{10pt}My suggestion:vspace{10pt}
begin{tabular}{lc*{3}{C{1.5em}}}
toprule
multicolumn{2}{c}{multirow{2}{*}{$P_{batt}$}}& multicolumn{3}{c}{$P_{mot}$} \ cmidrule{3-5}
multicolumn{2}{c}{} & S & M & H \ midrule
& S & S & Z & VS \ cmidrule(l){2-5}
SOC & M & M & Z & H \ cmidrule(l){2-5}
& H & M & Z & H \
bottomrule
end{tabular}
end{document}
Am a beginner in latex, that's why. I don;t know about this booktabs. Anyway thanks for the suggestion, I will look through it.
– sreeramp96
Nov 20 '18 at 7:27
add a comment |
With multirow
and multicolumn
you can reach what you need.
I have also created a new column type for centering the cell contents and redefined arraystretch
to have more vertical space between rows.
However, I would suggest you to get rid of the vertical rules and use booktabs
.
documentclass{article}
usepackage{array}
newcolumntype{C}[1]{>{centeringarraybackslash}p{#1}}
renewcommand{arraystretch}{1.3}
usepackage{multirow}
usepackage{booktabs}
begin{document}
Your table:vspace{10pt}
begin{tabular}{|p{0.6in}|C{0.3in}|C{0.4in}|C{0.4in}|C{0.4in}|} hline
multicolumn{2}{|c|}{multirow{2}{*}{$P_{batt}$}}& multicolumn{3}{c|}{$P_{mot}$} \ cline{3-5}
multicolumn{2}{|c|}{} & S & M & H \ hline
& S & S & Z & VS \ cline{2-5}
SOC & M & M & Z & H \ cline{2-5}
& H & M & Z & H \ hline
end{tabular}
vspace{10pt}My suggestion:vspace{10pt}
begin{tabular}{lc*{3}{C{1.5em}}}
toprule
multicolumn{2}{c}{multirow{2}{*}{$P_{batt}$}}& multicolumn{3}{c}{$P_{mot}$} \ cmidrule{3-5}
multicolumn{2}{c}{} & S & M & H \ midrule
& S & S & Z & VS \ cmidrule(l){2-5}
SOC & M & M & Z & H \ cmidrule(l){2-5}
& H & M & Z & H \
bottomrule
end{tabular}
end{document}
With multirow
and multicolumn
you can reach what you need.
I have also created a new column type for centering the cell contents and redefined arraystretch
to have more vertical space between rows.
However, I would suggest you to get rid of the vertical rules and use booktabs
.
documentclass{article}
usepackage{array}
newcolumntype{C}[1]{>{centeringarraybackslash}p{#1}}
renewcommand{arraystretch}{1.3}
usepackage{multirow}
usepackage{booktabs}
begin{document}
Your table:vspace{10pt}
begin{tabular}{|p{0.6in}|C{0.3in}|C{0.4in}|C{0.4in}|C{0.4in}|} hline
multicolumn{2}{|c|}{multirow{2}{*}{$P_{batt}$}}& multicolumn{3}{c|}{$P_{mot}$} \ cline{3-5}
multicolumn{2}{|c|}{} & S & M & H \ hline
& S & S & Z & VS \ cline{2-5}
SOC & M & M & Z & H \ cline{2-5}
& H & M & Z & H \ hline
end{tabular}
vspace{10pt}My suggestion:vspace{10pt}
begin{tabular}{lc*{3}{C{1.5em}}}
toprule
multicolumn{2}{c}{multirow{2}{*}{$P_{batt}$}}& multicolumn{3}{c}{$P_{mot}$} \ cmidrule{3-5}
multicolumn{2}{c}{} & S & M & H \ midrule
& S & S & Z & VS \ cmidrule(l){2-5}
SOC & M & M & Z & H \ cmidrule(l){2-5}
& H & M & Z & H \
bottomrule
end{tabular}
end{document}
edited Nov 20 '18 at 6:40
answered Nov 20 '18 at 6:12
CarLaTeX
29.7k447125
29.7k447125
Am a beginner in latex, that's why. I don;t know about this booktabs. Anyway thanks for the suggestion, I will look through it.
– sreeramp96
Nov 20 '18 at 7:27
add a comment |
Am a beginner in latex, that's why. I don;t know about this booktabs. Anyway thanks for the suggestion, I will look through it.
– sreeramp96
Nov 20 '18 at 7:27
Am a beginner in latex, that's why. I don;t know about this booktabs. Anyway thanks for the suggestion, I will look through it.
– sreeramp96
Nov 20 '18 at 7:27
Am a beginner in latex, that's why. I don;t know about this booktabs. Anyway thanks for the suggestion, I will look through it.
– sreeramp96
Nov 20 '18 at 7:27
add a comment |
Welcome to TeX.SE! In order to merge rows or columns, you need to use multirow
(which requires the multirow
package) or multicolumn
, respectively. And if you nest them, you need to do it in the right order.
documentclass{article}
usepackage{multirow}
begin{document}
begin{tabular}{|p{0.6in}|p{0.3in}|p{0.9in}|p{0.9in}|p{0.8in}|} hline
multicolumn{2}{|c|}{multirow{2}{*}{$P_mathrm{batt}$}} &
multicolumn{3}{|c|}{$P_mathrm{mot}$ } \ cline{3-5}
multicolumn{2}{|c|}{} & S & M & H \ cline{1-5}
multirow{3}{*}{SOC} & S & S & Z & VS \ cline{2-5}
& M & M & Z & H \ cline{2-5}
& H & M & Z & H \ hline
end{tabular}
end{document}
1
The initial|
inmulticolumn{3}{|c|}{$P_mathrm{mot}$ }
should be deleted, otherwise it is printed twice.
– CarLaTeX
Nov 20 '18 at 6:47
Yeah am not aware of all the methods. Thanks for the solution.
– sreeramp96
Nov 20 '18 at 7:29
add a comment |
Welcome to TeX.SE! In order to merge rows or columns, you need to use multirow
(which requires the multirow
package) or multicolumn
, respectively. And if you nest them, you need to do it in the right order.
documentclass{article}
usepackage{multirow}
begin{document}
begin{tabular}{|p{0.6in}|p{0.3in}|p{0.9in}|p{0.9in}|p{0.8in}|} hline
multicolumn{2}{|c|}{multirow{2}{*}{$P_mathrm{batt}$}} &
multicolumn{3}{|c|}{$P_mathrm{mot}$ } \ cline{3-5}
multicolumn{2}{|c|}{} & S & M & H \ cline{1-5}
multirow{3}{*}{SOC} & S & S & Z & VS \ cline{2-5}
& M & M & Z & H \ cline{2-5}
& H & M & Z & H \ hline
end{tabular}
end{document}
1
The initial|
inmulticolumn{3}{|c|}{$P_mathrm{mot}$ }
should be deleted, otherwise it is printed twice.
– CarLaTeX
Nov 20 '18 at 6:47
Yeah am not aware of all the methods. Thanks for the solution.
– sreeramp96
Nov 20 '18 at 7:29
add a comment |
Welcome to TeX.SE! In order to merge rows or columns, you need to use multirow
(which requires the multirow
package) or multicolumn
, respectively. And if you nest them, you need to do it in the right order.
documentclass{article}
usepackage{multirow}
begin{document}
begin{tabular}{|p{0.6in}|p{0.3in}|p{0.9in}|p{0.9in}|p{0.8in}|} hline
multicolumn{2}{|c|}{multirow{2}{*}{$P_mathrm{batt}$}} &
multicolumn{3}{|c|}{$P_mathrm{mot}$ } \ cline{3-5}
multicolumn{2}{|c|}{} & S & M & H \ cline{1-5}
multirow{3}{*}{SOC} & S & S & Z & VS \ cline{2-5}
& M & M & Z & H \ cline{2-5}
& H & M & Z & H \ hline
end{tabular}
end{document}
Welcome to TeX.SE! In order to merge rows or columns, you need to use multirow
(which requires the multirow
package) or multicolumn
, respectively. And if you nest them, you need to do it in the right order.
documentclass{article}
usepackage{multirow}
begin{document}
begin{tabular}{|p{0.6in}|p{0.3in}|p{0.9in}|p{0.9in}|p{0.8in}|} hline
multicolumn{2}{|c|}{multirow{2}{*}{$P_mathrm{batt}$}} &
multicolumn{3}{|c|}{$P_mathrm{mot}$ } \ cline{3-5}
multicolumn{2}{|c|}{} & S & M & H \ cline{1-5}
multirow{3}{*}{SOC} & S & S & Z & VS \ cline{2-5}
& M & M & Z & H \ cline{2-5}
& H & M & Z & H \ hline
end{tabular}
end{document}
edited Nov 20 '18 at 6:10
answered Nov 20 '18 at 6:00
marmot
87.7k4101189
87.7k4101189
1
The initial|
inmulticolumn{3}{|c|}{$P_mathrm{mot}$ }
should be deleted, otherwise it is printed twice.
– CarLaTeX
Nov 20 '18 at 6:47
Yeah am not aware of all the methods. Thanks for the solution.
– sreeramp96
Nov 20 '18 at 7:29
add a comment |
1
The initial|
inmulticolumn{3}{|c|}{$P_mathrm{mot}$ }
should be deleted, otherwise it is printed twice.
– CarLaTeX
Nov 20 '18 at 6:47
Yeah am not aware of all the methods. Thanks for the solution.
– sreeramp96
Nov 20 '18 at 7:29
1
1
The initial
|
in multicolumn{3}{|c|}{$P_mathrm{mot}$ }
should be deleted, otherwise it is printed twice.– CarLaTeX
Nov 20 '18 at 6:47
The initial
|
in multicolumn{3}{|c|}{$P_mathrm{mot}$ }
should be deleted, otherwise it is printed twice.– CarLaTeX
Nov 20 '18 at 6:47
Yeah am not aware of all the methods. Thanks for the solution.
– sreeramp96
Nov 20 '18 at 7:29
Yeah am not aware of all the methods. Thanks for the solution.
– sreeramp96
Nov 20 '18 at 7:29
add a comment |
Whatever applies to each item in a column should go in the column header. Here's my proposal:
documentclass[twocolumn]{article}
usepackage{array,booktabs}
usepackage{lipsum} % for context
begin{document}
lipsum[2]
begin{table}[htp]
centering
begin{tabular}{ @{} *{4}{w{c}{3em}} @{} }
toprule
$P_{mathrm{batt}}$ & multicolumn{3}{c}{$P_{mathrm{mot}}$} \
cmidrule(r){1-1} cmidrule(l){2-4}
SOC & S & M & H \
midrule
S & S & Z & VS \
M & M & Z & H \
H & M & Z & H \
bottomrule
end{tabular}
caption{Rule based of fuzzy logic control}
end{table}
lipsum
end{document}
add a comment |
Whatever applies to each item in a column should go in the column header. Here's my proposal:
documentclass[twocolumn]{article}
usepackage{array,booktabs}
usepackage{lipsum} % for context
begin{document}
lipsum[2]
begin{table}[htp]
centering
begin{tabular}{ @{} *{4}{w{c}{3em}} @{} }
toprule
$P_{mathrm{batt}}$ & multicolumn{3}{c}{$P_{mathrm{mot}}$} \
cmidrule(r){1-1} cmidrule(l){2-4}
SOC & S & M & H \
midrule
S & S & Z & VS \
M & M & Z & H \
H & M & Z & H \
bottomrule
end{tabular}
caption{Rule based of fuzzy logic control}
end{table}
lipsum
end{document}
add a comment |
Whatever applies to each item in a column should go in the column header. Here's my proposal:
documentclass[twocolumn]{article}
usepackage{array,booktabs}
usepackage{lipsum} % for context
begin{document}
lipsum[2]
begin{table}[htp]
centering
begin{tabular}{ @{} *{4}{w{c}{3em}} @{} }
toprule
$P_{mathrm{batt}}$ & multicolumn{3}{c}{$P_{mathrm{mot}}$} \
cmidrule(r){1-1} cmidrule(l){2-4}
SOC & S & M & H \
midrule
S & S & Z & VS \
M & M & Z & H \
H & M & Z & H \
bottomrule
end{tabular}
caption{Rule based of fuzzy logic control}
end{table}
lipsum
end{document}
Whatever applies to each item in a column should go in the column header. Here's my proposal:
documentclass[twocolumn]{article}
usepackage{array,booktabs}
usepackage{lipsum} % for context
begin{document}
lipsum[2]
begin{table}[htp]
centering
begin{tabular}{ @{} *{4}{w{c}{3em}} @{} }
toprule
$P_{mathrm{batt}}$ & multicolumn{3}{c}{$P_{mathrm{mot}}$} \
cmidrule(r){1-1} cmidrule(l){2-4}
SOC & S & M & H \
midrule
S & S & Z & VS \
M & M & Z & H \
H & M & Z & H \
bottomrule
end{tabular}
caption{Rule based of fuzzy logic control}
end{table}
lipsum
end{document}
answered Nov 20 '18 at 8:45
egreg
709k8618823165
709k8618823165
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%2f460878%2fhow-do-i-make-table-cells-that-span-more-than-one-column-or-row%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
5
Why not use a different (better) representation? Something that uses
booktabs
. Something like this?– Werner
Nov 20 '18 at 6:17
2
You might have a use for tablesgenerator.com to generate your latex tables, I often use this tool.
– Maxim
Nov 20 '18 at 9:19
1
Welcome to TeX.SX! Please make your code compilable (if possible), or at least complete it with
documentclass{...}
, the requiredusepackage
's,begin{document}
, andend{document}
. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem.– Martin Schröder
Nov 20 '18 at 12:34
Okay i will consider those methods
– sreeramp96
Dec 1 '18 at 1:12