doubled the end-of-line backslashes; corruption by system
Source Link
barbara beeton
  • 83.6k
  • 13
  • 209
  • 493

Before this stays completely unanswered, may I propose a solution that won't appeal to purists, but that might be a good approach for you.

There have been a couple of questions concerned with how TikZ matrices can be used as replacements for tables: TikZ matrix as a replacement for tabular, Horizontal row separation line in tikz matrix (like \hline in tabular). Since you're using beamer, you have TikZ loaded already, so this wouldn't require additional packages.

You can use matrix options like every even row/.style,every odd column/.style, row 1/.style and so on to adjust the appearance of your tables. Here's an example based on the snippets in your question:

tikz matrix as a table

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{matrix}
\begin{document}

\tikzset{ 
    table/.style={
        matrix of nodes,
        row sep=-\pgflinewidth,
        column sep=-\pgflinewidth,
        nodes={
            rectangle,
            draw=black,
            align=center
        },
        minimum height=1.5em,
        text depth=0.5ex,
        text height=2ex,
        nodes in empty cells,
%%
        every even row/.style={
            nodes={fill=gray!20}
        },
        column 1/.style={
            nodes={text width=2em,font=\bfseries}
        },
        row 1/.style={
            nodes={
                fill=black,
                text=white,
                font=\bfseries
            }
        }
    }
}

\begin{tikzpicture}

\matrix (first) [table,text width=6em]
{
& Monday   & Tuesday & Wednesday & Thursday & Friday\    Friday\\
1   & A & B & C & D & E \    \\
2   & F & G & H & J & K \    \\
3   & A & B & C & D & E \    \\
4   & F & G & H & J & K \    \\
};


\end{tikzpicture}
\end{document}

Before this stays completely unanswered, may I propose a solution that won't appeal to purists, but that might be a good approach for you.

There have been a couple of questions concerned with how TikZ matrices can be used as replacements for tables: TikZ matrix as a replacement for tabular, Horizontal row separation line in tikz matrix (like \hline in tabular). Since you're using beamer, you have TikZ loaded already, so this wouldn't require additional packages.

You can use matrix options like every even row/.style,every odd column/.style, row 1/.style and so on to adjust the appearance of your tables. Here's an example based on the snippets in your question:

tikz matrix as a table

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{matrix}
\begin{document}

\tikzset{ 
    table/.style={
        matrix of nodes,
        row sep=-\pgflinewidth,
        column sep=-\pgflinewidth,
        nodes={
            rectangle,
            draw=black,
            align=center
        },
        minimum height=1.5em,
        text depth=0.5ex,
        text height=2ex,
        nodes in empty cells,
%%
        every even row/.style={
            nodes={fill=gray!20}
        },
        column 1/.style={
            nodes={text width=2em,font=\bfseries}
        },
        row 1/.style={
            nodes={
                fill=black,
                text=white,
                font=\bfseries
            }
        }
    }
}

\begin{tikzpicture}

\matrix (first) [table,text width=6em]
{
& Monday   & Tuesday & Wednesday & Thursday & Friday\    1   & A & B & C & D & E \    2   & F & G & H & J & K \    3   & A & B & C & D & E \    4   & F & G & H & J & K \    };


\end{tikzpicture}
\end{document}

Before this stays completely unanswered, may I propose a solution that won't appeal to purists, but that might be a good approach for you.

There have been a couple of questions concerned with how TikZ matrices can be used as replacements for tables: TikZ matrix as a replacement for tabular, Horizontal row separation line in tikz matrix (like \hline in tabular). Since you're using beamer, you have TikZ loaded already, so this wouldn't require additional packages.

You can use matrix options like every even row/.style,every odd column/.style, row 1/.style and so on to adjust the appearance of your tables. Here's an example based on the snippets in your question:

tikz matrix as a table

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{matrix}
\begin{document}

\tikzset{ 
    table/.style={
        matrix of nodes,
        row sep=-\pgflinewidth,
        column sep=-\pgflinewidth,
        nodes={
            rectangle,
            draw=black,
            align=center
        },
        minimum height=1.5em,
        text depth=0.5ex,
        text height=2ex,
        nodes in empty cells,
%%
        every even row/.style={
            nodes={fill=gray!20}
        },
        column 1/.style={
            nodes={text width=2em,font=\bfseries}
        },
        row 1/.style={
            nodes={
                fill=black,
                text=white,
                font=\bfseries
            }
        }
    }
}

\begin{tikzpicture}

\matrix (first) [table,text width=6em]
{
& Monday   & Tuesday & Wednesday & Thursday & Friday\\
1   & A & B & C & D & E \\
2   & F & G & H & J & K \\
3   & A & B & C & D & E \\
4   & F & G & H & J & K \\
};


\end{tikzpicture}
\end{document}
replaced http://tex.stackexchange.com/ with https://tex.stackexchange.com/
Source Link

Before this stays completely unanswered, may I propose a solution that won't appeal to purists, but that might be a good approach for you.

There have been a couple of questions concerned with how TikZ matrices can be used as replacements for tables: TikZ matrix as a replacement for tabularTikZ matrix as a replacement for tabular, Horizontal row separation line in tikz matrix (like \hline in tabular)Horizontal row separation line in tikz matrix (like \hline in tabular). Since you're using beamer, you have TikZ loaded already, so this wouldn't require additional packages.

You can use matrix options like every even row/.style,every odd column/.style, row 1/.style and so on to adjust the appearance of your tables. Here's an example based on the snippets in your question:

tikz matrix as a table

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{matrix}
\begin{document}

\tikzset{ 
    table/.style={
        matrix of nodes,
        row sep=-\pgflinewidth,
        column sep=-\pgflinewidth,
        nodes={
            rectangle,
            draw=black,
            align=center
        },
        minimum height=1.5em,
        text depth=0.5ex,
        text height=2ex,
        nodes in empty cells,
%%
        every even row/.style={
            nodes={fill=gray!20}
        },
        column 1/.style={
            nodes={text width=2em,font=\bfseries}
        },
        row 1/.style={
            nodes={
                fill=black,
                text=white,
                font=\bfseries
            }
        }
    }
}

\begin{tikzpicture}

\matrix (first) [table,text width=6em]
{
& Monday   & Tuesday & Wednesday & Thursday & Friday\    1   & A & B & C & D & E \    2   & F & G & H & J & K \    3   & A & B & C & D & E \    4   & F & G & H & J & K \    };


\end{tikzpicture}
\end{document}

Before this stays completely unanswered, may I propose a solution that won't appeal to purists, but that might be a good approach for you.

There have been a couple of questions concerned with how TikZ matrices can be used as replacements for tables: TikZ matrix as a replacement for tabular, Horizontal row separation line in tikz matrix (like \hline in tabular). Since you're using beamer, you have TikZ loaded already, so this wouldn't require additional packages.

You can use matrix options like every even row/.style,every odd column/.style, row 1/.style and so on to adjust the appearance of your tables. Here's an example based on the snippets in your question:

tikz matrix as a table

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{matrix}
\begin{document}

\tikzset{ 
    table/.style={
        matrix of nodes,
        row sep=-\pgflinewidth,
        column sep=-\pgflinewidth,
        nodes={
            rectangle,
            draw=black,
            align=center
        },
        minimum height=1.5em,
        text depth=0.5ex,
        text height=2ex,
        nodes in empty cells,
%%
        every even row/.style={
            nodes={fill=gray!20}
        },
        column 1/.style={
            nodes={text width=2em,font=\bfseries}
        },
        row 1/.style={
            nodes={
                fill=black,
                text=white,
                font=\bfseries
            }
        }
    }
}

\begin{tikzpicture}

\matrix (first) [table,text width=6em]
{
& Monday   & Tuesday & Wednesday & Thursday & Friday\    1   & A & B & C & D & E \    2   & F & G & H & J & K \    3   & A & B & C & D & E \    4   & F & G & H & J & K \    };


\end{tikzpicture}
\end{document}

Before this stays completely unanswered, may I propose a solution that won't appeal to purists, but that might be a good approach for you.

There have been a couple of questions concerned with how TikZ matrices can be used as replacements for tables: TikZ matrix as a replacement for tabular, Horizontal row separation line in tikz matrix (like \hline in tabular). Since you're using beamer, you have TikZ loaded already, so this wouldn't require additional packages.

You can use matrix options like every even row/.style,every odd column/.style, row 1/.style and so on to adjust the appearance of your tables. Here's an example based on the snippets in your question:

tikz matrix as a table

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{matrix}
\begin{document}

\tikzset{ 
    table/.style={
        matrix of nodes,
        row sep=-\pgflinewidth,
        column sep=-\pgflinewidth,
        nodes={
            rectangle,
            draw=black,
            align=center
        },
        minimum height=1.5em,
        text depth=0.5ex,
        text height=2ex,
        nodes in empty cells,
%%
        every even row/.style={
            nodes={fill=gray!20}
        },
        column 1/.style={
            nodes={text width=2em,font=\bfseries}
        },
        row 1/.style={
            nodes={
                fill=black,
                text=white,
                font=\bfseries
            }
        }
    }
}

\begin{tikzpicture}

\matrix (first) [table,text width=6em]
{
& Monday   & Tuesday & Wednesday & Thursday & Friday\    1   & A & B & C & D & E \    2   & F & G & H & J & K \    3   & A & B & C & D & E \    4   & F & G & H & J & K \    };


\end{tikzpicture}
\end{document}
Source Link
Jake
  • 223.3k
  • 28
  • 751
  • 832

Before this stays completely unanswered, may I propose a solution that won't appeal to purists, but that might be a good approach for you.

There have been a couple of questions concerned with how TikZ matrices can be used as replacements for tables: TikZ matrix as a replacement for tabular, Horizontal row separation line in tikz matrix (like \hline in tabular). Since you're using beamer, you have TikZ loaded already, so this wouldn't require additional packages.

You can use matrix options like every even row/.style,every odd column/.style, row 1/.style and so on to adjust the appearance of your tables. Here's an example based on the snippets in your question:

tikz matrix as a table

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{matrix}
\begin{document}

\tikzset{ 
    table/.style={
        matrix of nodes,
        row sep=-\pgflinewidth,
        column sep=-\pgflinewidth,
        nodes={
            rectangle,
            draw=black,
            align=center
        },
        minimum height=1.5em,
        text depth=0.5ex,
        text height=2ex,
        nodes in empty cells,
%%
        every even row/.style={
            nodes={fill=gray!20}
        },
        column 1/.style={
            nodes={text width=2em,font=\bfseries}
        },
        row 1/.style={
            nodes={
                fill=black,
                text=white,
                font=\bfseries
            }
        }
    }
}

\begin{tikzpicture}

\matrix (first) [table,text width=6em]
{
& Monday   & Tuesday & Wednesday & Thursday & Friday\    1   & A & B & C & D & E \    2   & F & G & H & J & K \    3   & A & B & C & D & E \    4   & F & G & H & J & K \    };


\end{tikzpicture}
\end{document}