with use of the makecell package for more vertical space around cells' contents, defining two new commands for shorter table's code:
\documentclass{article}
\usepackage{array, makecell}
\newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}}
\newcommand\mcF[1]{\multicolumn{4}{|c|}{#1}}
\newcommand\mcT[1]{\multicolumn{2}{|c|}{#1}}
\usepackage[skip=1ex]{caption}
\begin{document}
\begin{table}
\setcellgapes{3pt}
\makegapedcells
\centering
\caption{Some caption for the table}
\begin{tabular}{|C{20mm}|*{3}{C{13mm}|}*{2}{C{20mm}|}}
\hline
\mcF{imm[31:12]} & rd & 0110111 \\ \hline
\mcF{imm[31:12]} & rd & 0010111 \\ \hline
\mcT{imm[11:0]} & rs1 & 000 & rd & 1100111 \\ \hline
imm[12\textbar10:5] & rs2 & rs1 & 000 & imm[4:1\textbar11] & 1100011 \\ \hline
0000000 & shamt & rs1 & 001 & rd & 0010011 \\
\hline
\end{tabular}
\end{table}
\end{document}

mcolumn type and\multicolumn... – May 14 '19 at 13:25\begin{tabular}{|p{4cm}|p{2cm}|p{2cm}|p{1cm}|p{2cm}|p{3cm}|p{2cm}|} \hline
Now I added the first line as: \multicolumn{4}{c}{imm[31:12]} & rd & 0110111 & TEST \\hline
but the result was a failure
– ex1led May 14 '19 at 13:32