The following code comes from a solution to the question (How to make tables with a small cell to the right inside another large cell?), but if I add a header with text longer than what is established the table is distorted, I would like the width of the columns to fit the content of the table header.
\documentclass[tikz,border=3mm]{standalone}
\usepackage{amsmath}
\usetikzlibrary{matrix, fit}
\begin{document}
\begin{tikzpicture}[
row 1/.style={nodes={draw=none}},
mmat/.style={matrix of math nodes,nodes in empty cells,
row sep=-\pgflinewidth,column sep=-\pgflinewidth,
nodes={minimum width=5.5em,minimum height=3.5em, draw,anchor=center, text depth=0.25ex,text height=0.8em}},
inlay/.style={label={[draw,thin,anchor=north east,minimum width=0em, minimum height=0em,inner sep=1.4pt]north east:#1}}]
\matrix[mmat] (mat){
& & & &\\
\mbox{long text one}
& \mbox{long text two}
&2
&3
&4
&5
&Oferta \\
1
& |[inlay=4]|11
& |[inlay=2]| 22
& |[inlay=5]|33
& |[inlay=5]| 44
& |[inlay=1]|55
&100 \\
};
\node[yshift=-1mm, fit=(mat-1-3)(mat-1-5)]{Destino};
\end{tikzpicture}
\end{document}
nodes={minimum width=6em,
-- and --\usepackage{makecell}
to break the long text into multi line of choice -- read the documentation for many more options available at -- mirrors.ibiblio.org/CTAN/macros/latex/contrib/makecell/…