[Tex/LaTex] How to create table with labels (first row and first column)

tables

Here is what I want:

enter image description here

And I created simple table as below:

\documentclass[11pt]{article}

\begin{document}

\begin{tabular}{c|cccccc}
     & 0.1    &  0.25   & 0.40    & 0.55    & 0.7     & 0.95   \\ \hline
  7  & 0.0052 &  \boxed{0.0031} &  0.0070 &  0.0075 &  0.0092 &  0.0048 \\
  8  & 0.0061 &  0.0075 &  0.0071 &  0.0065 &  0.0062 &  0.0078 \\
  9  & 0.0078 &  0.0087 &  0.0057 &  0.0079 &  0.0094 &  0.0060 \\
  10 & 0.0040 &  0.0061 &  0.0084 &  0.0062 &  0.0060 &  0.0053 \\
  11 & 0.0075 &  0.0056 &  0.0056 &  0.0056 &  0.0066 &  0.0097 \\
  12 & 0.0054 &  \boxed{0.0030} &  0.0088 &  0.0085 &  0.0056 &  0.0091 \\
  13 & 0.0077 &  0.0073 &  0.0059 &  0.0075 &  0.0049 &  0.0053 \\
  14 & 0.0062 &  0.0057 &  0.0099 &  0.0068 &  0.0087 &  0.0067 \\
  15 & 0.0061 &  0.0069 &  0.0101 &  0.0065 &  0.0080 &  0.0071 \\
\end{tabular}
\end{document}

Can someone please help me understand how can I put labels on first row and first column like show in image? Any help, links or resources would be appreciated.

Best Answer

In my experience, readers strongly dislike to have to crane their necks to read a column header that's been rotated 90 degrees, especially if there's just a single such column header. I therefore recommend you place the string "Number of Neurons in Hidden Layer" above the first column, while providing one line break in the string. Separately, I would also recommend that you dispense with all vertical lines in the table.

enter image description here

\documentclass[11pt]{article}
\usepackage{amsmath} % for \boxed and \smash[b] macros
\usepackage{booktabs}% for \midrule and \cmidrule macros
\newcommand\headercell[1]{%
   \smash[b]{\begin{tabular}[t]{@{}c@{}} #1 \end{tabular}}}

\begin{document}

\noindent
\begin{tabular}{@{} *{7}{c} @{}}
\headercell{Number of Neurons\\in Hidden Layer} & \multicolumn{6}{c@{}}{Learning Rate}\\
\cmidrule(l){2-7}
& 0.1 &  0.25 & 0.40 & 0.55 & 0.7 & 0.95   \\ 
\midrule
  7  & 0.0052 &  \boxed{0.0031} &  0.0070 &  0.0075 &  0.0092 &  0.0048 \\
  8  & 0.0061 &  0.0075 &  0.0071 &  0.0065 &  0.0062 &  0.0078 \\
  9  & 0.0078 &  0.0087 &  0.0057 &  0.0079 &  0.0094 &  0.0060 \\
  10 & 0.0040 &  0.0061 &  0.0084 &  0.0062 &  0.0060 &  0.0053 \\
  11 & 0.0075 &  0.0056 &  0.0056 &  0.0056 &  0.0066 &  0.0097 \\
  12 & 0.0054 &  \boxed{0.0030} &  0.0088 &  0.0085 &  0.0056 &  0.0091 \\
  13 & 0.0077 &  0.0073 &  0.0059 &  0.0075 &  0.0049 &  0.0053 \\
  14 & 0.0062 &  0.0057 &  0.0099 &  0.0068 &  0.0087 &  0.0067 \\
  15 & 0.0061 &  0.0069 &  0.0101 &  0.0065 &  0.0080 &  0.0071 \\
\end{tabular}
\end{document}