I have a simple table. I found that some of the Mathematical expressions cross the border of the cells. How to fix this problem?
I have the second question please which is also related to my table: I have merged five cells; how I can split it into two equal cells?
Thanks in advance.
\documentclass[10pt,a4paper]{article}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{caption}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{multirow}
\begin{document}
%
\begin{table}[]
\centering
\caption{First Table}
\label{my table}
\begin{tabular}{|l|l|l|c|c|l|}
\hline
Name & \multicolumn{1}{c|}{a} & \multicolumn{1}{c|}{b} & c & \multicolumn{1}{l|}{Test-1} & Test-2 \\ \hline
1 & aa & bb & \multirow{5}{*}{same} & \multirow{2}{*}{222-a} & \multicolumn{1}{c|}{\multirow{2}{*}{333-a}} \\ \cline{1-3}
2 & cc & dd & & & \multicolumn{1}{c|}{} \\ \cline{1-3} \cline{5-6}
3 & ee & ff & & \multirow{3}{*}{222-b} & \multirow{3}{*}{333-b} \\ \cline{1-3}
4 & $\sin^{2}\left(\frac{\pi}{M}\right)$ & gg & & & \\ \cline{1-3}
5 & hh & ii & & & \\ \hline
\end{tabular}
\end{table}
%
\end{document}



I have the second question please which is also related to my tableit is best to post each question separately. – Nasser Feb 04 '17 at 20:39\documentclassand ending\end{document}, to see what you are loading, setting, etc. – Joseph Wright Feb 04 '17 at 20:49