کد بالا رو به این شکل تغییر دادم درست شد:
\documentclass{article}
\usepackage[usenames,dvipsnames]{xcolor}
\usepackage{tcolorbox}
\usepackage{tabularx}
\usepackage{array}
\usepackage{colortbl}
\tcbuselibrary{skins}
\usepackage{xepersian}
%table
%mytable constuction:
\tcbset
{
ponyotab/.style=
{
enhanced,
fonttitle=\bfseries,
fontupper=\normalsize\sffamily\persian,
colback=white!,
colframe=black!65!white,
colbacktitle=gray!20!white,
coltitle=black,center title
}
}
\newtcolorbox{mytable}[3][]
{
ponyotab,
tabular*={\arrayrulecolor{black}\renewcommand{\arraystretch}{1.0}}{#2},% change 1.0 to change cell heights
title=جدول \ref{#3},
before={\begin{table}[htb]\refstepcounter{table}\label{#3}\centering},
after={\end{table}},
#1
}
\makeatletter
\tcbset
{
tabular*/.style 2 args={%
boxsep=0pt,top=0pt,bottom=0pt,leftupper=0pt,rightupper=0pt,
toptitle=1mm,bottomtitle=1mm,boxrule=0.5mm,hbox,
before upper={\def\arraystretch{1.1}#1%
\tcb@hack@currenvir\tabular{#2}},
after upper=\endtabular\arrayrulecolor{black}},
}
\makeatother
%end of mytable construction
\begin{document}
\begin{mytable}{c|c|c|c|c|c}{kk}
گروه & یک & دو & سه & چهار & جمع \\\hline
قرمز & 1000.00 & 2000.00 & 3000.00 & 4000.00 & 10000.00 \\\hline
سبز & 2000.00 & 3000.00 & 4000.00 & 5000.00 & 14000.00 \\\hline
آبی & 3000.00 & 4000.00 & 5000.00 & 6000.00 & 18000.00 \\\hline
جمع & 6000.00 & 9000.00 & 12000.00 & 15000.00 & 42000.00
\end{mytable}
\begin{mytable}{c|c}{trajome3}
تعداد صفحات
&
میزان تخفیف
\\\hline
$1$
صفحه
&
$0$
درصد
\end{mytable}
\end{document}