How to get the following table?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



How to get the following table?



I want to make this table: enter image description here



Whereas, I get this one: enter image description here
Any suggestions for the code I wrote below?


begincenter
begintabularc
& $A$ & NOT $A$ & SUM\ hline
$B$ & $P(A$ AND$,B)$ & $P($NOT $A$ AND$,B)$ & $P(B)$\
NOT $B$ &$P(A,$NOT$,B)$ &$P($NOT $A,$AND NOT$,B)$ & $P($NOT $B)$ \ hline
& $P(A)$ & $P($NOT $A)$& $1$\ hline
endtabular
endcenter





Welcome to TeX.SE! Can the text font not be the same?
– manooooh
54 mins ago




3 Answers
3



With no additional packages (I am assuming that Comic Sans is not your dream):


documentclassarticle


begindocument

begincenter
begintabularc
multicolumn1c& $A$ &multicolumn1c NOT $A$ &multicolumn1c SUM\
%hline
cline2-4
$B$ & $P(A$ AND$,B)$ & $P($NOT $A$ AND$,B)$ & $P(B)$\
NOT $B$ &$P(A,$NOT$,B)$ &$P($NOT $A,$AND NOT$,B)$ & $P($NOT $B)$ \
%hline
cline2-4
& $P(A)$ & $P($NOT $A)$& $1$\
%hline
cline2-4
endtabular
endcenter

enddocument



enter image description here



This is easy with blkarray:


blkarray


documentclassarticle
usepackage[utf8]inputenc
usepackage[T1]fontenc
usepackagemathtools, blkarray

begindocument

[ everymathdisplaystylesetlengthBAextrarowheight2pt
beginblockarraycccc
& A & textNOT A & SUM\
BAhhline~---
beginblockc
B & P(Atext ANDB) & P(textNOT Atext AND B) & P(B)\
textNOT B &P(Atext NOT B) &P(textNOT Atext AND NOT B) & P(textNOT B) \
BAhhline~
& P(A) & P(textNOT A)& 1\
BAhhline~---
endblock
endblockarray ]

enddocument



enter image description here



enter image description here



Use multicolumn command to suppress vertical ruling of specific cells. If the table width is not as you want, try to modify the width provided in textwidth


multicolumn


textwidth


documentclassarticle
usepackageamsmath
renewcommandarraystretch1.7
usepackageragged2e
usepackagetabularx
newcolumntypeC > arraybackslash Centering X
usepackagebooktabs
usepackagemakecell

begindocument


noindent
begintable*

centering
begintabularxtextwidth
multicolumn1c & multicolumn1c$A$ & multicolumn1c$A^'$ & multicolumn1cSUM
\
Xcline2-40.2mm
$B$ & $P(A text AND B)$ & $P(textNOT A text AND B)$ & $P(B)$
\
$B^'$ & $P(A text AND NOT B)$ & $P(textNOT A text AND NOT B)$ & $P($NOT $B)$
\
Xcline2-40.2mm
& $P(A)$ & $P($NOT $A)$& $1$
\
Xcline2-40.2mm
endtabularx

endtable*


enddocument






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

make 2 or more post in bootsrap

Store custom data using WC_Cart add_to_cart() method in Woocommerce 3

Firebase Auth - with Email and Password - Check user already registered