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













4















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


Here is the Problem



Btw can somebody tell me why I had to put 18 in multirow?










share|improve this question

















  • 2





    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















4















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


Here is the Problem



Btw can somebody tell me why I had to put 18 in multirow?










share|improve this question

















  • 2





    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













4












4








4








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


Here is the Problem



Btw can somebody tell me why I had to put 18 in multirow?










share|improve this question














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


Here is the Problem



Btw can somebody tell me why I had to put 18 in multirow?







tables color multirow cline






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 3 hours ago









KanieeKaniee

453




453







  • 2





    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












  • 2





    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







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










1 Answer
1






active

oldest

votes


















2














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.)



enter image description here



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





share|improve this answer




















  • 1





    The problem is still the same with this code. Only the color is darker.

    – Kaniee
    2 hours ago






  • 1





    @Sebastiano: Using hhline will fix the problem.

    – leandriis
    2 hours ago






  • 1





    Replace cline2-6 by hhline~ and load the hline package.

    – 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: 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










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



);













draft saved

draft discarded


















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









2














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.)



enter image description here



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





share|improve this answer




















  • 1





    The problem is still the same with this code. Only the color is darker.

    – Kaniee
    2 hours ago






  • 1





    @Sebastiano: Using hhline will fix the problem.

    – leandriis
    2 hours ago






  • 1





    Replace cline2-6 by hhline~ and load the hline package.

    – 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: 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















2














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.)



enter image description here



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





share|improve this answer




















  • 1





    The problem is still the same with this code. Only the color is darker.

    – Kaniee
    2 hours ago






  • 1





    @Sebastiano: Using hhline will fix the problem.

    – leandriis
    2 hours ago






  • 1





    Replace cline2-6 by hhline~ and load the hline package.

    – 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: 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













2












2








2







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.)



enter image description here



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





share|improve this answer















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.)



enter image description here



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






share|improve this answer














share|improve this answer



share|improve this answer








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: Using hhline will fix the problem.

    – leandriis
    2 hours ago






  • 1





    Replace cline2-6 by hhline~ and load the hline package.

    – 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: 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












  • 1





    The problem is still the same with this code. Only the color is darker.

    – Kaniee
    2 hours ago






  • 1





    @Sebastiano: Using hhline will fix the problem.

    – leandriis
    2 hours ago






  • 1





    Replace cline2-6 by hhline~ and load the hline package.

    – 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: 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







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

















draft saved

draft discarded
















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

Isabella Eugénie Boyer Biographie | Références | Menu de navigationmodifiermodifier le codeComparator to Compute the Relative Value of a U.S. Dollar Amount – 1774 to Present.

Join wedge with single bond in chemfigHow to make only one part of double bond bold with chemfig?Crossing bonds in chemfigjoining atoms in chemfig. Two adjacent molculesHow do I selectively change bond length in chemfig?Ugly bond joints in chemfigchemfig: reaction above arrowUsing the mhchem and chemfig packages in conjunctionBonding to specific element letter using chemfigResonance hybrids in chemfigScale chemfig molecule in beamer with tikzWhy does this chemfig bond with a hook start in the middle of the atom?

Should we avoid writing fiction about historical events without extensive research?How do we write a story about genocide committed by a fascist government without falling into the “Nazi Germany” cliché?Researching sensitive subjectsShould I avoid “lecturing” my readers?Archetypical/popular historical fictionHow to write a “strong” passage?Will what worked 'back then' work today? (Novels)Historical Fiction: using you and thouHow do you make characters relatable if they exist in a completely different moral context?How do I write a MODERN combat/violence scene without being dry?Fictionizing firsthand accounts from history?Is it possible to narrate a novel in a faux-historical style without alienating the reader?