ausgefüllter Kreis im Tabellenfeld

ausgefüllter Kreis im Tabellenfeld

Im Moment verwende ich Beamer und habe eine Tabelle in einem Rahmen: Alles funktioniert gut, außer dass die Tabelle dort auseinanderbricht, wo ich diesen farbig ausgefüllten Kreis setze, aber ich möchte den Kreis nur innerhalb des Tabellenfelds haben, nicht die Tabelle links und rechts daneben, wenn Sie wissen, was ich meine.

\documentclass[leqno,8pt,fleqn,table]{beamer}
\usepackage{tikz}
\usetikzlibrary{matrix}

\tikzset{
table/.style={
    matrix of nodes,
    row sep=-\pgflinewidth,
    column sep=-\pgflinewidth,
    nodes={
        rectangle,
        draw=black,
        align=center,
               },
                    %baseline={([yshift=-0.5ex]current bounding box.center)},
    minimum height=1.5em,
    text depth=0.5em,
    text height=1em,
            text centered,
    nodes in empty cells,
    %%
                            row 1/.style={
        nodes={
            fill=black,
            text=white,
            %font=\bfseries
        }
    },
            rows/.style={nodes={fill=gray!10}},
            columns/.style={nodes={text width = 10em}},
            %myrowstyle/.style={
                %row #1/.style={nodes={fill=gray!10}}
    %},
   }
}

\begin{document}
\begin{frame}
\begin{center}
\begin{tiny}
    \begin{tikzpicture}
    \matrix[table, rows={2,...,3}{fill=grey!10}, columns={1,...,5}{text width = 10em}, ampersand replacement=\&] (first)
    { 
        card \# \& date \& 1 \& 2 \& 3 \\
        ghul \& 01.01.2016 \& \fill[green] (1,0) circle (0.05); \& \fill[red] (1,0) circle (0.05); \& \fill[red] (1,0) circle (0.05); \\
};
\end{tikzpicture}
\end{tiny}
%\vspace{4mm}
\end{center}
\end{frame}
\end{document}

Antwort1

Wenn ich es richtig verstehe, möchten Sie grüne und rote Kreise innerhalb von und (first-2-3). wobei die Zeilennummer und die Spaltennummern innerhalb der Matrix darstellen, hier eine Lösung(first-2-4)(first-2-5)23,4,5first

\documentclass[leqno,8pt,fleqn,table]{beamer}
\usepackage{tikz}
\usetikzlibrary{matrix,shadings}

\def\r{0.1}

\tikzset{
    table/.style={
        matrix of nodes,
        row sep=-\pgflinewidth,
        column sep=-\pgflinewidth,
        nodes={
            rectangle,
            draw=black,
            align=center,
                   },
                        %baseline={([yshift=-0.5ex]current bounding box.center)},
        minimum height=1.5em,
        text depth=0.5em,
        text height=1em,
                text centered,
        nodes in empty cells,
%%
                                row 1/.style={
            nodes={
                fill=black,
                text=white,
                %font=\bfseries
            }
        },
                rows/.style={nodes={fill=gray!10}},
                columns/.style={nodes={text width = 10em}},
                %myrowstyle/.style={
                    %row #1/.style={nodes={fill=gray!10}}
        %},
    }
}

\begin{document}
\begin{frame}
\begin{center}
\begin{tiny}
    \begin{tikzpicture}
    \matrix[table, rows={2,...,3}{fill=grey!10}, columns={1,...,5}{text width = 10em}, ampersand replacement=\&] (first)
    { 
        card \# \& date \& 1 \& 2 \& 3 \\
        ghul \& 01.01.2016 \&  \&  \&  \\
};

\fill[left color=green,right color=red] (first-2-3) circle (\r);
\fill[red] (first-2-4) circle (\r);
\fill[red] (first-2-5) circle (\r);

\end{tikzpicture}
\end{tiny}
%\vspace{4mm}
\end{center}
\end{frame}
\end{document}

Ausgabe

Bildbeschreibung hier eingeben

verwandte Informationen