I've got my little examples
env with
\newlist{examples}{enumerate}{1}
\setlist[examples]{label=(\arabic*), ref=\arabic*, resume}
How do I use the same counter for the table
env?
Well, I may have misunderstood the question. But is it like this?
\documentclass[a4paper]{article}
\usepackage{enumitem}
\newlist{examples}{enumerate}{1}
\begin{document}
\setcounter{table}{4}
\begin{examples}[label=(\thetable.\arabic*)]
\item {text to center}
\item {text to center}
\end{examples}
\begin{table}[htb]
\centering
\begin{tabular}{|c|c|}
\hline
1 & 2 \\\hline
3 & 4 \\
\hline
\end{tabular}
\caption{This is one table}\label{tab:mytab}
\end{table}
\begin{examples}[label=(\thetable.\arabic*)]
\item {text to center}
\item {text to center}
\end{examples}
\end{document}
The settings of the list can be made global by
\setlist[examples]{label=(\thetable.\arabic*)}
Code:
\documentclass[a4paper]{article}
\usepackage{enumitem}
\newlist{examples}{enumerate}{1}
\setlist[examples]{label=(\thetable.\arabic*)}
\begin{document}
\setcounter{table}{4}
\begin{examples}
\item {text to center}
\item {text to center}
\end{examples}
\begin{table}[htb]
\centering
\begin{tabular}{|c|c|}
\hline
1 & 2 \\\hline
3 & 4 \\
\hline
\end{tabular}
\caption{This is one table}\label{tab:mytab}
\end{table}
\begin{examples}
\item {text to center}
\item {text to center}
\end{examples}
\end{document}
This will take the last value of \thetable
as the first digit and second digit will be the usual arabic numbers.
table
. So,\arabic{table}
should yields its value? I am not sure what you want to do with it though. To access it's value you should refer to What is the proper method of accessing a counter?.\setcounter{table}{<num>}
to change the value of the table counter to a specific number?