Colored cell removes lineHow to format table with long column head entries?Table cell vertical line missingHow to prevent the borders of colored cell from disappearHow to get a cell colored in bordermatrix?cellcolor removes hlinetabu package - gaps in vertical linesColored tabular - line not showingMulti-colored cell backgroundHow to draw multiple colored bars in a table?table cell colored with multirow lets text disapear behind next colored cell
Short story about an infectious indestructible metal bar?
Draw this image in the TIKZ package
Inorganic chemistry handbook with reaction lists
Tabular environment - text vertically positions itself by bottom of tikz picture in adjacent cell
What is Tony Stark injecting into himself in Iron Man 3?
Vector-transposing function
Paper published similar to PhD thesis
What does *dead* mean in *What do you mean, dead?*?
Generating a list with duplicate entries
Can I challenge the interviewer to give me a proper technical feedback?
Is it a Cyclops number? "Nobody" knows!
What is the best index strategy or query SELECT when performing a search/lookup BETWEEN IP address (IPv4 and IPv6) ranges?
Too soon for a plot twist?
How does learning spells work when leveling a multiclass character?
Why does this boat have a landing pad? (SpaceX's GO Searcher) Any plans for propulsive capsule landings?
Finding integer solution to a quadratic equation in two unknowns
Why is there an extra space when I type "ls" on the Desktop?
Do I need a return ticket to Canada if I'm a Japanese National?
How to add theme from github with composer
Why isn't P and P/poly trivially the same?
Why do we say 'Pairwise Disjoint', rather than 'Disjoint'?
Should I file my taxes? No income, unemployed, but paid 2k in student loan interest
An Undercover Army
How can I portion out frozen cookie dough?
Colored cell removes line
How to format table with long column head entries?Table cell vertical line missingHow to prevent the borders of colored cell from disappearHow to get a cell colored in bordermatrix?cellcolor removes hlinetabu package - gaps in vertical linesColored tabular - line not showingMulti-colored cell backgroundHow to draw multiple colored bars in a table?table cell colored with multirow lets text disapear behind next colored cell
I have a Problem with coloring a cell in a table because it removes the upper line of the cell. I already found out that there are some issues with cellcolor and cline but I couldn't come up with a solution that works with multicolumn.
documentclassarticle
usepackageamsmath
usepackagemultirow
usepackagemulticol
usepackagerotating
usepackage[table]xcolor
usepackagesiunitx
begindocument
begintabularc
cline3-6
multicolumn2 & multicolumn4Anzahl der Nullstellen \
cline3-6
multicolumn2 & 0 & 1 & 2 & 3 \
hline
multirow18*rotatebox[origin=c]90Anzahl der Polstellen & 1 & $beginmatrix SI99.9percent \ SI37.7percent \ SI43.8percent \ SI45.1percentendmatrix$ & $beginmatrix SI99.9percent \ SI41.5percent \ SI67.5percent \ SI72.6percentendmatrix$ & multicolumn2 \
cline2-5
& 2 & $beginmatrix SI99.9percent \ SI72percent \ SI78.4percent \ SI77.8percentendmatrix$ & $beginmatrix SI99.9percent \ SI72.6percent \ SI92.5percent \ SI94.4percentendmatrix$ & $beginmatrix SI99.5percent \ SI72.7percent \ SI97.2percent \ SI98.3percentendmatrix$ & \
cline2-6
& 3 & $beginmatrix SI98.6percent \ SI-42.7percent \ SI95.7percent \ SI94.2percentendmatrix$ & cellcolorblack!25 $beginmatrix SI99.9percent \ SI73.4percent \ SI99.1percent \ SI99.3percentendmatrix$ & $beginmatrix SI99.9percent \ SI-40.1percent \ SI99.3percent \ SI96.7percentendmatrix$ & $beginmatrix SI99.7percent \ SI72.8percent \ SI99.4percent \ SI98percentendmatrix$ \
cline2-6
& 4 & $beginmatrix SI0percent \ SI67.8percent \ SI93.2percent \ SI93percentendmatrix$ & $beginmatrix SI99.5percent \ SI-23.5percent \ SI95.4percent \ SI93percentendmatrix$ & $beginmatrix SI99.9percent \ SI73.9percent \ SI5.3percent \ SI93percentendmatrix$ & $beginmatrix SI99.9percent \ SI74percent \ SI-87.1percent \ SI96.5percentendmatrix$ \
cline2-6
& 5 & $beginmatrix SI-99.7percent \ SI-82.9percent \ SI-99.4percent \ SI93percentendmatrix$ & $beginmatrix SI-99.8percent \ SI64.9percent \ SI2.7percent \ SI93percentendmatrix$ & $beginmatrix SI-100.5percent \ SI-69.8percent \ SI59.1percent \ SI93percentendmatrix$ & $beginmatrix SI-0.4percent \ SI73.9percent \ SI14.4percent \ SI93.1percentendmatrix$ \
hline
endtabular
enddocument

Btw can somebody tell me why I had to put 18 in multirow?
tables color multirow cline
add a comment |
I have a Problem with coloring a cell in a table because it removes the upper line of the cell. I already found out that there are some issues with cellcolor and cline but I couldn't come up with a solution that works with multicolumn.
documentclassarticle
usepackageamsmath
usepackagemultirow
usepackagemulticol
usepackagerotating
usepackage[table]xcolor
usepackagesiunitx
begindocument
begintabularc
cline3-6
multicolumn2 & multicolumn4Anzahl der Nullstellen \
cline3-6
multicolumn2 & 0 & 1 & 2 & 3 \
hline
multirow18*rotatebox[origin=c]90Anzahl der Polstellen & 1 & $beginmatrix SI99.9percent \ SI37.7percent \ SI43.8percent \ SI45.1percentendmatrix$ & $beginmatrix SI99.9percent \ SI41.5percent \ SI67.5percent \ SI72.6percentendmatrix$ & multicolumn2 \
cline2-5
& 2 & $beginmatrix SI99.9percent \ SI72percent \ SI78.4percent \ SI77.8percentendmatrix$ & $beginmatrix SI99.9percent \ SI72.6percent \ SI92.5percent \ SI94.4percentendmatrix$ & $beginmatrix SI99.5percent \ SI72.7percent \ SI97.2percent \ SI98.3percentendmatrix$ & \
cline2-6
& 3 & $beginmatrix SI98.6percent \ SI-42.7percent \ SI95.7percent \ SI94.2percentendmatrix$ & cellcolorblack!25 $beginmatrix SI99.9percent \ SI73.4percent \ SI99.1percent \ SI99.3percentendmatrix$ & $beginmatrix SI99.9percent \ SI-40.1percent \ SI99.3percent \ SI96.7percentendmatrix$ & $beginmatrix SI99.7percent \ SI72.8percent \ SI99.4percent \ SI98percentendmatrix$ \
cline2-6
& 4 & $beginmatrix SI0percent \ SI67.8percent \ SI93.2percent \ SI93percentendmatrix$ & $beginmatrix SI99.5percent \ SI-23.5percent \ SI95.4percent \ SI93percentendmatrix$ & $beginmatrix SI99.9percent \ SI73.9percent \ SI5.3percent \ SI93percentendmatrix$ & $beginmatrix SI99.9percent \ SI74percent \ SI-87.1percent \ SI96.5percentendmatrix$ \
cline2-6
& 5 & $beginmatrix SI-99.7percent \ SI-82.9percent \ SI-99.4percent \ SI93percentendmatrix$ & $beginmatrix SI-99.8percent \ SI64.9percent \ SI2.7percent \ SI93percentendmatrix$ & $beginmatrix SI-100.5percent \ SI-69.8percent \ SI59.1percent \ SI93percentendmatrix$ & $beginmatrix SI-0.4percent \ SI73.9percent \ SI14.4percent \ SI93.1percentendmatrix$ \
hline
endtabular
enddocument

Btw can somebody tell me why I had to put 18 in multirow?
tables color multirow cline
2
Usinghhlineas usually recommended in connection withcellcolorshould also work in your case. (hhline~)
– leandriis
2 hours ago
Thank you, this worked for me. I tried it already before but did something wrong.
– Kaniee
2 hours ago
add a comment |
I have a Problem with coloring a cell in a table because it removes the upper line of the cell. I already found out that there are some issues with cellcolor and cline but I couldn't come up with a solution that works with multicolumn.
documentclassarticle
usepackageamsmath
usepackagemultirow
usepackagemulticol
usepackagerotating
usepackage[table]xcolor
usepackagesiunitx
begindocument
begintabularc
cline3-6
multicolumn2 & multicolumn4Anzahl der Nullstellen \
cline3-6
multicolumn2 & 0 & 1 & 2 & 3 \
hline
multirow18*rotatebox[origin=c]90Anzahl der Polstellen & 1 & $beginmatrix SI99.9percent \ SI37.7percent \ SI43.8percent \ SI45.1percentendmatrix$ & $beginmatrix SI99.9percent \ SI41.5percent \ SI67.5percent \ SI72.6percentendmatrix$ & multicolumn2 \
cline2-5
& 2 & $beginmatrix SI99.9percent \ SI72percent \ SI78.4percent \ SI77.8percentendmatrix$ & $beginmatrix SI99.9percent \ SI72.6percent \ SI92.5percent \ SI94.4percentendmatrix$ & $beginmatrix SI99.5percent \ SI72.7percent \ SI97.2percent \ SI98.3percentendmatrix$ & \
cline2-6
& 3 & $beginmatrix SI98.6percent \ SI-42.7percent \ SI95.7percent \ SI94.2percentendmatrix$ & cellcolorblack!25 $beginmatrix SI99.9percent \ SI73.4percent \ SI99.1percent \ SI99.3percentendmatrix$ & $beginmatrix SI99.9percent \ SI-40.1percent \ SI99.3percent \ SI96.7percentendmatrix$ & $beginmatrix SI99.7percent \ SI72.8percent \ SI99.4percent \ SI98percentendmatrix$ \
cline2-6
& 4 & $beginmatrix SI0percent \ SI67.8percent \ SI93.2percent \ SI93percentendmatrix$ & $beginmatrix SI99.5percent \ SI-23.5percent \ SI95.4percent \ SI93percentendmatrix$ & $beginmatrix SI99.9percent \ SI73.9percent \ SI5.3percent \ SI93percentendmatrix$ & $beginmatrix SI99.9percent \ SI74percent \ SI-87.1percent \ SI96.5percentendmatrix$ \
cline2-6
& 5 & $beginmatrix SI-99.7percent \ SI-82.9percent \ SI-99.4percent \ SI93percentendmatrix$ & $beginmatrix SI-99.8percent \ SI64.9percent \ SI2.7percent \ SI93percentendmatrix$ & $beginmatrix SI-100.5percent \ SI-69.8percent \ SI59.1percent \ SI93percentendmatrix$ & $beginmatrix SI-0.4percent \ SI73.9percent \ SI14.4percent \ SI93.1percentendmatrix$ \
hline
endtabular
enddocument

Btw can somebody tell me why I had to put 18 in multirow?
tables color multirow cline
I have a Problem with coloring a cell in a table because it removes the upper line of the cell. I already found out that there are some issues with cellcolor and cline but I couldn't come up with a solution that works with multicolumn.
documentclassarticle
usepackageamsmath
usepackagemultirow
usepackagemulticol
usepackagerotating
usepackage[table]xcolor
usepackagesiunitx
begindocument
begintabularc
cline3-6
multicolumn2 & multicolumn4Anzahl der Nullstellen \
cline3-6
multicolumn2 & 0 & 1 & 2 & 3 \
hline
multirow18*rotatebox[origin=c]90Anzahl der Polstellen & 1 & $beginmatrix SI99.9percent \ SI37.7percent \ SI43.8percent \ SI45.1percentendmatrix$ & $beginmatrix SI99.9percent \ SI41.5percent \ SI67.5percent \ SI72.6percentendmatrix$ & multicolumn2 \
cline2-5
& 2 & $beginmatrix SI99.9percent \ SI72percent \ SI78.4percent \ SI77.8percentendmatrix$ & $beginmatrix SI99.9percent \ SI72.6percent \ SI92.5percent \ SI94.4percentendmatrix$ & $beginmatrix SI99.5percent \ SI72.7percent \ SI97.2percent \ SI98.3percentendmatrix$ & \
cline2-6
& 3 & $beginmatrix SI98.6percent \ SI-42.7percent \ SI95.7percent \ SI94.2percentendmatrix$ & cellcolorblack!25 $beginmatrix SI99.9percent \ SI73.4percent \ SI99.1percent \ SI99.3percentendmatrix$ & $beginmatrix SI99.9percent \ SI-40.1percent \ SI99.3percent \ SI96.7percentendmatrix$ & $beginmatrix SI99.7percent \ SI72.8percent \ SI99.4percent \ SI98percentendmatrix$ \
cline2-6
& 4 & $beginmatrix SI0percent \ SI67.8percent \ SI93.2percent \ SI93percentendmatrix$ & $beginmatrix SI99.5percent \ SI-23.5percent \ SI95.4percent \ SI93percentendmatrix$ & $beginmatrix SI99.9percent \ SI73.9percent \ SI5.3percent \ SI93percentendmatrix$ & $beginmatrix SI99.9percent \ SI74percent \ SI-87.1percent \ SI96.5percentendmatrix$ \
cline2-6
& 5 & $beginmatrix SI-99.7percent \ SI-82.9percent \ SI-99.4percent \ SI93percentendmatrix$ & $beginmatrix SI-99.8percent \ SI64.9percent \ SI2.7percent \ SI93percentendmatrix$ & $beginmatrix SI-100.5percent \ SI-69.8percent \ SI59.1percent \ SI93percentendmatrix$ & $beginmatrix SI-0.4percent \ SI73.9percent \ SI14.4percent \ SI93.1percentendmatrix$ \
hline
endtabular
enddocument

Btw can somebody tell me why I had to put 18 in multirow?
tables color multirow cline
tables color multirow cline
asked 3 hours ago
KanieeKaniee
453
453
2
Usinghhlineas usually recommended in connection withcellcolorshould also work in your case. (hhline~)
– leandriis
2 hours ago
Thank you, this worked for me. I tried it already before but did something wrong.
– Kaniee
2 hours ago
add a comment |
2
Usinghhlineas usually recommended in connection withcellcolorshould also work in your case. (hhline~)
– leandriis
2 hours ago
Thank you, this worked for me. I tried it already before but did something wrong.
– Kaniee
2 hours ago
2
2
Using
hhline as usually recommended in connection with cellcolor should also work in your case. (hhline~)– leandriis
2 hours ago
Using
hhline as usually recommended in connection with cellcolor should also work in your case. (hhline~)– leandriis
2 hours ago
Thank you, this worked for me. I tried it already before but did something wrong.
– Kaniee
2 hours ago
Thank you, this worked for me. I tried it already before but did something wrong.
– Kaniee
2 hours ago
add a comment |
1 Answer
1
active
oldest
votes
As @leandris has kindly suggested in a comment, to make sure that the horizontal line shows up fully, it suffices to (a) load the hhline package and (b) replace the cline3-6 directive in question with hhline~~----.
In addition, you may want to simplify your code considerably. For instance, by employing an array environment instead of a tabular environment, you can get rid of all $ symbols. There's no real discernible need for encasing the percentage numbers in SI...... wrappers.
(The "missing" vertical line to the left of the shaded cell is an artifact of the low resolution of the screenshot; in a normal pdf file it'll show up just fine.)

documentclassarticle
usepackagemathtools,hhline
usepackagemultirow
usepackagerotating
usepackage[table]xcolor
usepackagesiunitx
begindocument
[
setlengthextrarowheight1pt
beginarray*6
cline3-6
multicolumn2
& multicolumn4textAnzahl der Nullstellen \
cline3-6
multicolumn2 & 0 & 1 & 2 & 3 \
hline
multirow17*rotatebox[origin=c]90Anzahl der Polstellen
& 1
& beginmatrix*[r] phantom-99.9% \ 37.7% \ 43.8% \ 45.1%endmatrix*
& beginmatrix*[r] phantom-99.9% \ 41.5% \ 67.5% \ 72.6%endmatrix*
& multicolumn2 \
cline2-5
& 2
& beginmatrix*[r] phantom-99.9% \ 72.0% \ 78.4% \ 77.8%endmatrix*
& beginmatrix*[r] phantom-99.9% \ 72.6% \ 92.5% \ 94.4%endmatrix*
& beginmatrix*[r] phantom-199.5% \ 72.7% \ 97.2% \ 98.3%endmatrix*
& \
%cline2-6
hhline~~----
& 3
& beginmatrix*[r] 98.6% \ -42.7% \ 95.7% \ 94.2%endmatrix*
& cellcolorblack!12
beginmatrix*[r] phantom-99.9% \ 73.4% \ 99.1% \ 99.3%endmatrix*
& beginmatrix*[r] phantom-199.9% \ -40.1% \ 99.3% \ 96.7%endmatrix*
& beginmatrix*[r] phantom-99.7% \ 72.8% \ 99.4% \ 98%endmatrix* \
cline2-6
& 4
& beginmatrix*[r] 0.0% \ phantom-67.8% \ 93.2% \ 93.0%endmatrix*
& beginmatrix*[r] 99.5% \ -23.5% \ 95.4% \ 93.0%endmatrix*
& beginmatrix*[r] phantom-199.9% \ 73.9% \ 5.3% \ 93.0%endmatrix*
& beginmatrix*[r] 99.9% \ 74% \ -87.1% \ 96.5%endmatrix* \
cline2-6
& 5
& beginmatrix*[r] -99.7% \ -82.9% \ -99.4% \ 93.0%endmatrix*
& beginmatrix*[r] -99.8% \ 64.9% \ 2.7% \ 93.0%endmatrix*
& beginmatrix*[r] -100.5% \ -69.8% \ 59.1% \ 93.0%endmatrix*
& beginmatrix*[r] -0.4% \ 73.9% \ 14.4% \ phantom-93.1%endmatrix* \
hline
endarray
]
enddocument
1
The problem is still the same with this code. Only the color is darker.
– Kaniee
2 hours ago
1
@Sebastiano: Usinghhlinewill fix the problem.
– leandriis
2 hours ago
1
Replacecline2-6byhhline~and load thehlinepackage.
– leandriis
2 hours ago
1
I've edited your code to implement @leadris's keen suggestion, and also to streamline some of other code provided by the OP. Feel free to revert.
– Mico
2 hours ago
1
@Sebastiano:booktabsdoes not cooperate very well with vertical lines, so, although I personally use booktabs quite often, this package is most likely not applicable to this specific question.
– leandriis
2 hours ago
|
show 6 more comments
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%2f478482%2fcolored-cell-removes-line%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
As @leandris has kindly suggested in a comment, to make sure that the horizontal line shows up fully, it suffices to (a) load the hhline package and (b) replace the cline3-6 directive in question with hhline~~----.
In addition, you may want to simplify your code considerably. For instance, by employing an array environment instead of a tabular environment, you can get rid of all $ symbols. There's no real discernible need for encasing the percentage numbers in SI...... wrappers.
(The "missing" vertical line to the left of the shaded cell is an artifact of the low resolution of the screenshot; in a normal pdf file it'll show up just fine.)

documentclassarticle
usepackagemathtools,hhline
usepackagemultirow
usepackagerotating
usepackage[table]xcolor
usepackagesiunitx
begindocument
[
setlengthextrarowheight1pt
beginarray*6
cline3-6
multicolumn2
& multicolumn4textAnzahl der Nullstellen \
cline3-6
multicolumn2 & 0 & 1 & 2 & 3 \
hline
multirow17*rotatebox[origin=c]90Anzahl der Polstellen
& 1
& beginmatrix*[r] phantom-99.9% \ 37.7% \ 43.8% \ 45.1%endmatrix*
& beginmatrix*[r] phantom-99.9% \ 41.5% \ 67.5% \ 72.6%endmatrix*
& multicolumn2 \
cline2-5
& 2
& beginmatrix*[r] phantom-99.9% \ 72.0% \ 78.4% \ 77.8%endmatrix*
& beginmatrix*[r] phantom-99.9% \ 72.6% \ 92.5% \ 94.4%endmatrix*
& beginmatrix*[r] phantom-199.5% \ 72.7% \ 97.2% \ 98.3%endmatrix*
& \
%cline2-6
hhline~~----
& 3
& beginmatrix*[r] 98.6% \ -42.7% \ 95.7% \ 94.2%endmatrix*
& cellcolorblack!12
beginmatrix*[r] phantom-99.9% \ 73.4% \ 99.1% \ 99.3%endmatrix*
& beginmatrix*[r] phantom-199.9% \ -40.1% \ 99.3% \ 96.7%endmatrix*
& beginmatrix*[r] phantom-99.7% \ 72.8% \ 99.4% \ 98%endmatrix* \
cline2-6
& 4
& beginmatrix*[r] 0.0% \ phantom-67.8% \ 93.2% \ 93.0%endmatrix*
& beginmatrix*[r] 99.5% \ -23.5% \ 95.4% \ 93.0%endmatrix*
& beginmatrix*[r] phantom-199.9% \ 73.9% \ 5.3% \ 93.0%endmatrix*
& beginmatrix*[r] 99.9% \ 74% \ -87.1% \ 96.5%endmatrix* \
cline2-6
& 5
& beginmatrix*[r] -99.7% \ -82.9% \ -99.4% \ 93.0%endmatrix*
& beginmatrix*[r] -99.8% \ 64.9% \ 2.7% \ 93.0%endmatrix*
& beginmatrix*[r] -100.5% \ -69.8% \ 59.1% \ 93.0%endmatrix*
& beginmatrix*[r] -0.4% \ 73.9% \ 14.4% \ phantom-93.1%endmatrix* \
hline
endarray
]
enddocument
1
The problem is still the same with this code. Only the color is darker.
– Kaniee
2 hours ago
1
@Sebastiano: Usinghhlinewill fix the problem.
– leandriis
2 hours ago
1
Replacecline2-6byhhline~and load thehlinepackage.
– leandriis
2 hours ago
1
I've edited your code to implement @leadris's keen suggestion, and also to streamline some of other code provided by the OP. Feel free to revert.
– Mico
2 hours ago
1
@Sebastiano:booktabsdoes not cooperate very well with vertical lines, so, although I personally use booktabs quite often, this package is most likely not applicable to this specific question.
– leandriis
2 hours ago
|
show 6 more comments
As @leandris has kindly suggested in a comment, to make sure that the horizontal line shows up fully, it suffices to (a) load the hhline package and (b) replace the cline3-6 directive in question with hhline~~----.
In addition, you may want to simplify your code considerably. For instance, by employing an array environment instead of a tabular environment, you can get rid of all $ symbols. There's no real discernible need for encasing the percentage numbers in SI...... wrappers.
(The "missing" vertical line to the left of the shaded cell is an artifact of the low resolution of the screenshot; in a normal pdf file it'll show up just fine.)

documentclassarticle
usepackagemathtools,hhline
usepackagemultirow
usepackagerotating
usepackage[table]xcolor
usepackagesiunitx
begindocument
[
setlengthextrarowheight1pt
beginarray*6
cline3-6
multicolumn2
& multicolumn4textAnzahl der Nullstellen \
cline3-6
multicolumn2 & 0 & 1 & 2 & 3 \
hline
multirow17*rotatebox[origin=c]90Anzahl der Polstellen
& 1
& beginmatrix*[r] phantom-99.9% \ 37.7% \ 43.8% \ 45.1%endmatrix*
& beginmatrix*[r] phantom-99.9% \ 41.5% \ 67.5% \ 72.6%endmatrix*
& multicolumn2 \
cline2-5
& 2
& beginmatrix*[r] phantom-99.9% \ 72.0% \ 78.4% \ 77.8%endmatrix*
& beginmatrix*[r] phantom-99.9% \ 72.6% \ 92.5% \ 94.4%endmatrix*
& beginmatrix*[r] phantom-199.5% \ 72.7% \ 97.2% \ 98.3%endmatrix*
& \
%cline2-6
hhline~~----
& 3
& beginmatrix*[r] 98.6% \ -42.7% \ 95.7% \ 94.2%endmatrix*
& cellcolorblack!12
beginmatrix*[r] phantom-99.9% \ 73.4% \ 99.1% \ 99.3%endmatrix*
& beginmatrix*[r] phantom-199.9% \ -40.1% \ 99.3% \ 96.7%endmatrix*
& beginmatrix*[r] phantom-99.7% \ 72.8% \ 99.4% \ 98%endmatrix* \
cline2-6
& 4
& beginmatrix*[r] 0.0% \ phantom-67.8% \ 93.2% \ 93.0%endmatrix*
& beginmatrix*[r] 99.5% \ -23.5% \ 95.4% \ 93.0%endmatrix*
& beginmatrix*[r] phantom-199.9% \ 73.9% \ 5.3% \ 93.0%endmatrix*
& beginmatrix*[r] 99.9% \ 74% \ -87.1% \ 96.5%endmatrix* \
cline2-6
& 5
& beginmatrix*[r] -99.7% \ -82.9% \ -99.4% \ 93.0%endmatrix*
& beginmatrix*[r] -99.8% \ 64.9% \ 2.7% \ 93.0%endmatrix*
& beginmatrix*[r] -100.5% \ -69.8% \ 59.1% \ 93.0%endmatrix*
& beginmatrix*[r] -0.4% \ 73.9% \ 14.4% \ phantom-93.1%endmatrix* \
hline
endarray
]
enddocument
1
The problem is still the same with this code. Only the color is darker.
– Kaniee
2 hours ago
1
@Sebastiano: Usinghhlinewill fix the problem.
– leandriis
2 hours ago
1
Replacecline2-6byhhline~and load thehlinepackage.
– leandriis
2 hours ago
1
I've edited your code to implement @leadris's keen suggestion, and also to streamline some of other code provided by the OP. Feel free to revert.
– Mico
2 hours ago
1
@Sebastiano:booktabsdoes not cooperate very well with vertical lines, so, although I personally use booktabs quite often, this package is most likely not applicable to this specific question.
– leandriis
2 hours ago
|
show 6 more comments
As @leandris has kindly suggested in a comment, to make sure that the horizontal line shows up fully, it suffices to (a) load the hhline package and (b) replace the cline3-6 directive in question with hhline~~----.
In addition, you may want to simplify your code considerably. For instance, by employing an array environment instead of a tabular environment, you can get rid of all $ symbols. There's no real discernible need for encasing the percentage numbers in SI...... wrappers.
(The "missing" vertical line to the left of the shaded cell is an artifact of the low resolution of the screenshot; in a normal pdf file it'll show up just fine.)

documentclassarticle
usepackagemathtools,hhline
usepackagemultirow
usepackagerotating
usepackage[table]xcolor
usepackagesiunitx
begindocument
[
setlengthextrarowheight1pt
beginarray*6
cline3-6
multicolumn2
& multicolumn4textAnzahl der Nullstellen \
cline3-6
multicolumn2 & 0 & 1 & 2 & 3 \
hline
multirow17*rotatebox[origin=c]90Anzahl der Polstellen
& 1
& beginmatrix*[r] phantom-99.9% \ 37.7% \ 43.8% \ 45.1%endmatrix*
& beginmatrix*[r] phantom-99.9% \ 41.5% \ 67.5% \ 72.6%endmatrix*
& multicolumn2 \
cline2-5
& 2
& beginmatrix*[r] phantom-99.9% \ 72.0% \ 78.4% \ 77.8%endmatrix*
& beginmatrix*[r] phantom-99.9% \ 72.6% \ 92.5% \ 94.4%endmatrix*
& beginmatrix*[r] phantom-199.5% \ 72.7% \ 97.2% \ 98.3%endmatrix*
& \
%cline2-6
hhline~~----
& 3
& beginmatrix*[r] 98.6% \ -42.7% \ 95.7% \ 94.2%endmatrix*
& cellcolorblack!12
beginmatrix*[r] phantom-99.9% \ 73.4% \ 99.1% \ 99.3%endmatrix*
& beginmatrix*[r] phantom-199.9% \ -40.1% \ 99.3% \ 96.7%endmatrix*
& beginmatrix*[r] phantom-99.7% \ 72.8% \ 99.4% \ 98%endmatrix* \
cline2-6
& 4
& beginmatrix*[r] 0.0% \ phantom-67.8% \ 93.2% \ 93.0%endmatrix*
& beginmatrix*[r] 99.5% \ -23.5% \ 95.4% \ 93.0%endmatrix*
& beginmatrix*[r] phantom-199.9% \ 73.9% \ 5.3% \ 93.0%endmatrix*
& beginmatrix*[r] 99.9% \ 74% \ -87.1% \ 96.5%endmatrix* \
cline2-6
& 5
& beginmatrix*[r] -99.7% \ -82.9% \ -99.4% \ 93.0%endmatrix*
& beginmatrix*[r] -99.8% \ 64.9% \ 2.7% \ 93.0%endmatrix*
& beginmatrix*[r] -100.5% \ -69.8% \ 59.1% \ 93.0%endmatrix*
& beginmatrix*[r] -0.4% \ 73.9% \ 14.4% \ phantom-93.1%endmatrix* \
hline
endarray
]
enddocument
As @leandris has kindly suggested in a comment, to make sure that the horizontal line shows up fully, it suffices to (a) load the hhline package and (b) replace the cline3-6 directive in question with hhline~~----.
In addition, you may want to simplify your code considerably. For instance, by employing an array environment instead of a tabular environment, you can get rid of all $ symbols. There's no real discernible need for encasing the percentage numbers in SI...... wrappers.
(The "missing" vertical line to the left of the shaded cell is an artifact of the low resolution of the screenshot; in a normal pdf file it'll show up just fine.)

documentclassarticle
usepackagemathtools,hhline
usepackagemultirow
usepackagerotating
usepackage[table]xcolor
usepackagesiunitx
begindocument
[
setlengthextrarowheight1pt
beginarray*6
cline3-6
multicolumn2
& multicolumn4textAnzahl der Nullstellen \
cline3-6
multicolumn2 & 0 & 1 & 2 & 3 \
hline
multirow17*rotatebox[origin=c]90Anzahl der Polstellen
& 1
& beginmatrix*[r] phantom-99.9% \ 37.7% \ 43.8% \ 45.1%endmatrix*
& beginmatrix*[r] phantom-99.9% \ 41.5% \ 67.5% \ 72.6%endmatrix*
& multicolumn2 \
cline2-5
& 2
& beginmatrix*[r] phantom-99.9% \ 72.0% \ 78.4% \ 77.8%endmatrix*
& beginmatrix*[r] phantom-99.9% \ 72.6% \ 92.5% \ 94.4%endmatrix*
& beginmatrix*[r] phantom-199.5% \ 72.7% \ 97.2% \ 98.3%endmatrix*
& \
%cline2-6
hhline~~----
& 3
& beginmatrix*[r] 98.6% \ -42.7% \ 95.7% \ 94.2%endmatrix*
& cellcolorblack!12
beginmatrix*[r] phantom-99.9% \ 73.4% \ 99.1% \ 99.3%endmatrix*
& beginmatrix*[r] phantom-199.9% \ -40.1% \ 99.3% \ 96.7%endmatrix*
& beginmatrix*[r] phantom-99.7% \ 72.8% \ 99.4% \ 98%endmatrix* \
cline2-6
& 4
& beginmatrix*[r] 0.0% \ phantom-67.8% \ 93.2% \ 93.0%endmatrix*
& beginmatrix*[r] 99.5% \ -23.5% \ 95.4% \ 93.0%endmatrix*
& beginmatrix*[r] phantom-199.9% \ 73.9% \ 5.3% \ 93.0%endmatrix*
& beginmatrix*[r] 99.9% \ 74% \ -87.1% \ 96.5%endmatrix* \
cline2-6
& 5
& beginmatrix*[r] -99.7% \ -82.9% \ -99.4% \ 93.0%endmatrix*
& beginmatrix*[r] -99.8% \ 64.9% \ 2.7% \ 93.0%endmatrix*
& beginmatrix*[r] -100.5% \ -69.8% \ 59.1% \ 93.0%endmatrix*
& beginmatrix*[r] -0.4% \ 73.9% \ 14.4% \ phantom-93.1%endmatrix* \
hline
endarray
]
enddocument
edited 2 hours ago
Mico
282k31385774
282k31385774
answered 2 hours ago
SebastianoSebastiano
10.7k42163
10.7k42163
1
The problem is still the same with this code. Only the color is darker.
– Kaniee
2 hours ago
1
@Sebastiano: Usinghhlinewill fix the problem.
– leandriis
2 hours ago
1
Replacecline2-6byhhline~and load thehlinepackage.
– leandriis
2 hours ago
1
I've edited your code to implement @leadris's keen suggestion, and also to streamline some of other code provided by the OP. Feel free to revert.
– Mico
2 hours ago
1
@Sebastiano:booktabsdoes not cooperate very well with vertical lines, so, although I personally use booktabs quite often, this package is most likely not applicable to this specific question.
– leandriis
2 hours ago
|
show 6 more comments
1
The problem is still the same with this code. Only the color is darker.
– Kaniee
2 hours ago
1
@Sebastiano: Usinghhlinewill fix the problem.
– leandriis
2 hours ago
1
Replacecline2-6byhhline~and load thehlinepackage.
– leandriis
2 hours ago
1
I've edited your code to implement @leadris's keen suggestion, and also to streamline some of other code provided by the OP. Feel free to revert.
– Mico
2 hours ago
1
@Sebastiano:booktabsdoes not cooperate very well with vertical lines, so, although I personally use booktabs quite often, this package is most likely not applicable to this specific question.
– leandriis
2 hours ago
1
1
The problem is still the same with this code. Only the color is darker.
– Kaniee
2 hours ago
The problem is still the same with this code. Only the color is darker.
– Kaniee
2 hours ago
1
1
@Sebastiano: Using
hhline will fix the problem.– leandriis
2 hours ago
@Sebastiano: Using
hhline will fix the problem.– leandriis
2 hours ago
1
1
Replace
cline2-6 by hhline~ and load the hline package.– leandriis
2 hours ago
Replace
cline2-6 by hhline~ and load the hline package.– leandriis
2 hours ago
1
1
I've edited your code to implement @leadris's keen suggestion, and also to streamline some of other code provided by the OP. Feel free to revert.
– Mico
2 hours ago
I've edited your code to implement @leadris's keen suggestion, and also to streamline some of other code provided by the OP. Feel free to revert.
– Mico
2 hours ago
1
1
@Sebastiano:
booktabs does not cooperate very well with vertical lines, so, although I personally use booktabs quite often, this package is most likely not applicable to this specific question.– leandriis
2 hours ago
@Sebastiano:
booktabs does not cooperate very well with vertical lines, so, although I personally use booktabs quite often, this package is most likely not applicable to this specific question.– leandriis
2 hours ago
|
show 6 more comments
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f478482%2fcolored-cell-removes-line%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
Using
hhlineas usually recommended in connection withcellcolorshould also work in your case. (hhline~)– leandriis
2 hours ago
Thank you, this worked for me. I tried it already before but did something wrong.
– Kaniee
2 hours ago