[Tex/LaTex] Table with different column widths

tables

I wish to create a table that has different row column size. How can i achieve something like that? enter image description here

EDIT #1:

I tried

\begin{tabular}{|p{4cm}|p{2cm}|p{2cm}|p{1cm}|p{2cm}|p{3cm}|p{2cm}|} \hline
    \multicolumn{4}{c}{imm[31:12]}  &   rd  & 0110111 & TEST \\\hline

\end{tabular}

And the result is this

enter image description here

Best Answer

How about this? I try to reproduce the first five rows of your table.

\documentclass{article}
\usepackage{array}
% https://tex.stackexchange.com/a/12712/156344
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\begin{document}
\begin{table}
\caption{Some caption for the table}
\begin{tabular}{|C{2cm}|C{1cm}|C{1cm}|C{1cm}|C{2cm}|C{1.5cm}|} \hline
    \multicolumn{4}{|c|}{imm[31:12]} & rd & 0110111 \\\hline
    \multicolumn{4}{|c|}{imm[31:12]} & rd & 0010111 \\\hline
    \multicolumn{4}{|c|}{imm[20\textbar10:1\textbar11\textbar19:12]} & rd & 1101111 \\\hline
    \multicolumn{2}{|c|}{imm[11:0]} & rs1 & 000 & rd & 1100111 \\\hline
    imm[12\textbar10:5] & rs2 & rs1 & 000 & imm[4:1\textbar11] & 1100011\\\hline
\end{tabular}
\end{table}
\end{document}

enter image description here