[Tex/LaTex] How to keep table and equations to the left side

equationshorizontal alignment

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\begin{document}
First find how many days between July 22 and Nov 4
    \[\begin{tabular}{|ccc|}
    \hline 
    Month &       & days \\
    \hline \hline
    July  &  31-22  & 9 \\
    August &       & 31 \\
    September &       & 30 \\
    October &&31\\
    November&&4\\
    \hline \hline
    \multicolumn{2}{|c}{total } & 105 days \\
    \hline
   \end{tabular}\]

\begin{flalign*} 
PV &= \frac{FV}{1+r \times t} \\\\
 &= \frac{1000}{\left(1+0.07 \times \frac{105}{365}\right)} \\\\
 &= \dfrac{2000}{1.020137}\\\\
 &= \$980.26
\end{flalign*}
\end{document}

I would like to keep everything to the left, but currently the table is centred.

Best Answer

Since you have defined a table inside a display equation(!), you may use fleqn as the option for the documentclass.

\documentclass[12pt,a4paper,fleqn]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\setlength\mathindent{0pt} %% reduce the indent for equations to 0pt.
\begin{document}
First find how many days between July 22 and Nov 4
    \[\begin{tabular}{|ccc|}
    \hline
    Month &       & days \\
    \hline \hline
    July  &  31-22  & 9 \\
    August &       & 31 \\
    September &       & 30 \\
    October &&31\\
    November&&4\\
    \hline \hline
    \multicolumn{2}{|c}{total } & 105 days \\
    \hline
   \end{tabular}\]

    \begin{flalign*}
PV &= \frac{FV}{1+r \times t} \\\\
 &= \frac{1000}{\left(1+0.07 \times \frac{105}{365}\right)} \\\\
 &= \dfrac{2000}{1.020137}\\\\
 &= \$980.26
\end{flalign*}
\end{document}

enter image description here

Update:

Now it is time to do things in right way. tabular need not be used inside \[...\]. And as noted by Gonzalo, instead of using double \\ to leave some extra vertical space between equations, one can use the optional argument like\\[<len>], where <len> can be \jot or any unit of length like pt or cm or multiples of baselineskip as in this example, where nothing is changed in the preamble:

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}    
\begin{document}

First find how many days between July 22 and Nov 4
\par\noindent
\begin{tabular}{|ccc|}
    \hline
    Month &       & days \\
    \hline \hline
    July  &  31-22  & 9 \\
    August &       & 31 \\
    September &       & 30 \\
    October &&31\\
    November&&4\\
    \hline \hline
    \multicolumn{2}{|c}{total } & 105 days \\
    \hline
\end{tabular}
here
\begin{flalign*}
    PV  &= \frac{FV}{1+r \times t} && \\[\jot]
        &= \frac{1000}{\left(1+0.07 \times \dfrac{105}{365}\right)} && \\[.5cm]
        &= \dfrac{2000}{1.020137} && \\[\baselineskip] 
        &= \$980.26 &&
\end{flalign*}
\end{document}