I want to write a code to get a network package structure.
1 var 4
-------------------------------------
| Control | Casa | Mia |
Currently I have the code below, but I have noticed that I get two lines in stead of 1 between the cell Control and Casa. Any help?
\documentclass{article}
\usepackage[latin9]{inputenc}
%\usepackage[utf8x]{inputenc}
%\usepackage[spanish]{babel}
%\usepackage[spanish]{translator}
\usepackage[OT1]{fontenc}
%TikZ stuff
\usepackage{tikz}
\usepackage{pgfplots}
\usepackage{pgf}
\usetikzlibrary{shapes,arrows,automata,plotmarks,positioning}
\begin{document}
\begin{tikzpicture}%[scale=1.5]
\tikzstyle{every path}=[draw, font=\small]
\node[right,draw, minimum width=2cm,minimum height=0.8cm,fill=white](b0) {Control};
\node[right=0cm of b0, draw, minimum width=2cm,minimum height=0.8cm,fill=white](b0) {Casa};
\end{tikzpicture}
\end{document}
Edit 1:
Now I have this, but figure is not center, and don't now how to make a line from the corners of control to get to the total of the other row
\begin{figure}
\newcommand{\size}{\linewidth}
\begin{tikzpicture}%[scale=1]
\tikzstyle{every path}=[draw, font=\small]
\node[right,draw, minimum width=0.15*\size,minimum height=0.8cm,fill=white](b0) {Control};
\node[above=-0.2 of b0, minimum width=0.15*\size,minimum height=0.8cm] {1};
\node[above left=-0.2 and -0.5 of b0, minimum width=0.2*\size,minimum height=0.8cm] {byte};
\node[right=0cm of b0, draw, minimum width=0.2*\size,minimum height=0.8cm,fill=white](b1) {Longitud};
\node[above=-0.2 of b1, minimum width=0.2*\size,minimum height=0.8cm] {1};
\node[right=0cm of b1, draw, minimum width=0.6*\size,minimum height=0.8cm,fill=white](b2) {Valor};
\node[above=-0.2 of b2, minimum width=0.6*\size,minimum height=0.8cm] {8};
\node[below left=1 and -2 of b0 ,draw, minimum width=0.2*\size,minimum height=0.8cm,fill=white](h0) {Bloqueo};
\node[below=-0.2 of h0, minimum width=0.15*\size,minimum height=0.8cm] {1};
\node[below left=-0.2 and -0.5 of h0, minimum width=0.15*\size,minimum height=0.8cm] {bit};
\node[right=0cm of h0, draw, minimum width=0.3*\size,minimum height=0.8cm,fill=white](h1) {M\'{a}ximo n$^o$ intentos};
\node[below=-0.2 of h1, minimum width=0.2*\size,minimum height=0.8cm] {3};
\node[right=0cm of h1, draw, minimum width=0.2*\size,minimum height=0.8cm,fill=white](h2) {RSV};
\node[below=-0.2 of h2, minimum width=0.2*\size,minimum height=0.8cm] {1};
\node[right=0cm of h2, draw, minimum width=0.4*\size,minimum height=0.8cm,fill=white](h3) {Intentos restantes};
\node[below=-0.2 of h3, minimum width=0.4*\size,minimum height=0.8cm] {3};
\end{tikzpicture}
\caption{Mi figura}
\end{figure}
Best Answer
As was suggested, I think
matrix
is a good option to draw byte and bit fields. Next code show how to use two matrices with two rows each one and how to join their corners to represent that the second one is a detailed field.