So I was making two tables and was having issues with the formatting. So how you give spaces in these table and how to align that 1st table with the caption on side?
\begin{table}[]
\caption{DNA Encoding and Decoding Rule}
\label{tab:my-table}
\setlength{\tabcolsep}{0.5em} % for the horizontal padding
{\renewcommand{\arraystretch}{1.2}% for the vertical padding
\begin{tabular}{@{}lllll@{}}
\toprule
& 00 & 10 & 01 & 11 \\ \midrule
Rule 1 & A & C & G & T \\
Rule 2 & A & G & C & T \\
Rule 3 & T & G & C & A \\
Rule 4 & T & C & G & A \\
Rule 5 & G & A & T & C \\
Rule 6 & G & T & A & C \\
Rule 7 & C & A & T & G \\
Rule 8 & C & T & A & G \\ \bottomrule
\end{tabular}
}
\end{table}
\begin{table}[]
\caption{Mutation effect example}
\label{tab:my-table}
\resizebox{\columnwidth}{!}{%
\begin{tabular}{@{}lllll@{}}
\toprule
\begin{tabular}[c]{@{}l@{}}Original \\ \\ Number\end{tabular} & DNA sequence & Type of mutation & Mutated sequence & Number corresponding to mutated sequence \\ \midrule
237 & ‘TCTG’ & Deletion & ‘TTG’ & 61 \\ \midrule
237 & ‘TCTG’ & Insertion & ‘TCATG’ & 909 \\
237 & ‘TCTG’ & Substitution & ‘TCAG’ & 225 \\
237 & ‘TCTG’ & Duplication & ‘TCTTG’ & 957
\end{tabular}%
}
\end{table}
hvfloat
by Herbert Voß provides the ability to put a caption to the side, along with many other possibilities. See the package documentation and/or the TUGboat article that describes it.