I am very new to LaTeX. I made this table mostly copying online tables without any understanding. And why are the contents in column not centered? Don't mind some irrelevant packages that I might have added
Here's the code:
\documentclass{article}
\usepackage{graphicx,fancyhdr,amsmath,amssymb,amsthm,subfig,url,hyperref}
\usepackage[margin=1in]{geometry}
\newtheorem{theorem}{Theorem}
\newcommand{\myname}{xxxxxxxx}
\newcommand{\myid}{xxxxxxxx}
\newcommand{\hwNo}{xxxxxxxxxx}
%%% END
\fancypagestyle{plain}{}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[RO,LE]{\sffamily\bfseries\large LUMS}
\fancyhead[LO,RE]{\sffamily\bfseries\large CS-210 Discrete Mathematics}
\fancyfoot[LO,RE]{\sffamily\bfseries\large \myname: \myid @lums.edu.pk}
\fancyfoot[RO,LE]{\sffamily\bfseries\thepage}
\renewcommand{\headrulewidth}{1pt}
\renewcommand{\footrulewidth}{1pt}
\renewcommand{\arraystretch}{2}
%--------------------- This is the title of the document. DO NOT CHANGE IT ------------------------
\title{CS-210 \hwNo}
\author{\myname \qquad Student ID: \myid}
%--------------------------------- AFTER Entering the Student and Homework Information, write your answers below ----------------------------------
\begin{document}
\maketitle
\section{Problem 1}
\begin{table}[h!]
\centering
\caption{A}
\begin{tabular}{|l|l|l|l|l|l|l|l|l|l|l|l|l|}
\hline
A & B & C & $\overline{A}$ & $\overline{B}$ & $\overline{C}$ & A$\cap$B & $\overline{A} \cap$C & A$ \cap \overline{B}$ & $\overline{A} \cap \overline{C}$ & A$\cap$B $ \cup $ $\overline{A} \cap$C & $ (\ ( \ A \cap B )\ \cup (\ \overline{A} \cap C )\ )\ \complement $ & $ (\ A \cap \overline{B} )\ \cup (\ \overline{A} \cap \overline{C} )\ $ \\
\hline\hline
1& 1& 1 & 0 & 0 & 0 &1 &0 &0 &0 &1 &0 & 0 \\
1& 1 & 0 & 0 & 0 & 1 & 1 & 0 & 0 & 0 & 1 & 0 & 0\\
1& 0 & 1 & 0 & 1 & 0 & 0 & 0 & 1 & 0 & 0 & 1& 1\\
1& 0 & 0 & 0 & 1 & 1 & 0 & 0 & 1 & 0 & 0 & 1& 1\\
0& 1 & 1 & 1 & 0 & 0 & 0 & 1 & 0 & 0& 1 & 0& 0\\
0& 1& 0& 1 & 0 & 1 & 0 & 0 & 0 & 1& 0 & 1& 1\\
0& 0 & 1 & 1 & 1 & 0 & 0 & 1 & 0 & 0& 1 & 0 & 0\\
0& 0 & 0& 1 & 1 &1 & 0 & 0 & 0 & 1& 0 & 1 & 1\\
\hline
\end{tabular}
\end{table}
\end{document}



ccolumn type, not thelcolumn type. Hint:lmeans "left-alignment"... – Mico Sep 22 '18 at 15:40