1

I made a table using some website

\begin{table}[h]
    \begin{tabular}{|c|c|c|c|c|}
        \hline
            \textbf{\begin{tabular}[c]{@{}c@{}}Mathematical \\ Term\end{tabular}} & \textbf{\begin{tabular}[c]{@{}c@{}}English \\ Expression\end{tabular}} & \textbf{\begin{tabular}[c]{@{}c@{}}Symbolic \\ Term\end{tabular}} & \multicolumn{2}{r|}{\textbf{\begin{tabular}[c]{@{}r@{}}Truth \\ \\ Table\end{tabular}}} \\ \hline
            &                                                                           &                                                                      & \textbf{p}                                 & \textbf{p'}                                \\ \cline{4-5} 
            Negation                                                                 & Not P                                                                     & p'                                                                   & T                                          & F                                          \\ \cline{4-5} 
            &                                                                           &                                                                      & F                                          & T                                          \\ \hline
    \end{tabular}
\end{table}

When I placed it under my \begin{enumerate} I faced this issue

enter image description here

I don't know how to:

1) Make the table have some padding so that the borders don't look like its squishing the table

2) Move the table to under/center it relative to 1)

Hoping someone can show me how to do these. Thanks in advance for the help.

Arszilla
  • 139

1 Answers1

1

You're using a float environment. Float environments are not designed to work as you appear to wish. To do what you want, get rid of the float environment.

Here's something that perhaps achieves what you want:

\documentclass{article}
\usepackage[margin=1.25in,showframe]{geometry}
\begin{document}

\begin{enumerate}
  \item The negation of $p$, denoted by $\neg p$, 
    \begin{center}
        \begin{tabular}{|c|c|c|c|c|}
            \hline
                \textbf{\begin{tabular}[c]{@{}c@{}}Mathematical \\ Term\end{tabular}} & \textbf{\begin{tabular}[c]{@{}c@{}}English \\ Expression\end{tabular}} & \textbf{\begin{tabular}[c]{@{}c@{}}Symbolic \\ Term\end{tabular}} & \multicolumn{2}{r|}{\textbf{\begin{tabular}[c]{@{}r@{}}Truth \\ \\ Table\end{tabular}}} \\ \hline
                &                                                                           &                                                                      & \textbf{p}                                 & \textbf{p'}                                \\ \cline{4-5} 
                Negation                                                                 & Not P                                                                     & p'                                                                   & T                                          & F                                          \\ \cline{4-5} 
                &                                                                           &                                                                      & F                                          & T                                          \\ \hline
        \end{tabular}%%
    \end{center}
  \item something else
\end{enumerate}

\end{document}

enter image description here

Personally, unless your lines fill the width of the page, this can look awkward or a bit off. But, by removing the table (float) environment you'll have greater control to place the table where you want.

There are other approaches to centering objects on the page. The question "When should we use \begin{center} instead of \centering?" contains some information you might find useful.

Incidentally, I suspect you wrote ~p expecting to get

enter image description here

But, that's not going to work. ~ creates an unbreakable space. It's generally used between words you don't want broken across lines such as with short titles and last names: Mr.~So-and-so.

To get the squiggle, you can do something like, ${\sim}p$. Generally, \sim is a binary relation, which has extra whitespace padding built in around it. The brackets essentially remove this padding.

Also, personally, I find $p^\prime$ (or $p'$) looks much better than p' outside of a math context.

A.Ellett
  • 50,533
  • I used p' here due to the fact that I needed it to be bolded. Thanks for the assistance! I am still learning TeX and this was quite helpful! – Arszilla Sep 22 '18 at 02:00
  • Getting math content to be bolded can be quite frustrating at times. But for p', you can get this bold using $\mathbf{p'}$. – A.Ellett Sep 22 '18 at 02:14