Try the before upper app={\rowcolor{yellow!30!white}
key -- code which is introduced before the first line of tabularx
is shipped out.
(See section 18.1 'hooks' of the current (3.72) manual of tcolorbox
)
\documentclass[border=5mm,
preview]{standalone}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[dvipsnames,svgnames,table]{xcolor}
\usepackage{makecell,tabularx}
\newcolumntype{L}{>{\raggedright\arraybackslash}X}
\usepackage[many]{tcolorbox}
\newtcolorbox{tctabularx}[1]{%
enhanced,
fonttitle=\sffamily\bfseries, fontupper=\small\sffamily,
arc=0mm,
colback=yellow!10!white, colframe=red!50!black,
#1,before upper app={\rowcolor{yellow!30!white}}
}% end tctabularx
\begin{document}
\begin{tctabularx}{tabularx={L|L}}
\thead{FIR}
& \thead{IIR} \\
\hline
končni impulzni odziv $h[n]$
& neskončni impulzni odziv $h[n]$ \\
\hline
sistemska funkcija je polinom
& sistemska funkcija je racionalna\newline
(ulomek dveh polinomov) \\
\hline
zahtevnejša izvedba
& manj zahtevna izvedba \\
\end{tctabularx}
\end{document}
I would do such stuff by using a tcbraster
or tcbitemize
inside an outer tcolorbox
. The following code example creates colored stripes in blue and red, but every stripe could be given an individual color:
\documentclass{article}
\usepackage[many]{tcolorbox}%
\usepackage{lipsum,geometry}
\begin{document}
\begin{tcolorbox}[enhanced,
boxsep=0pt,top=0pt,bottom=0pt,leftupper=0pt,rightupper=0pt,
toptitle=1mm,bottomtitle=1mm,lefttitle=5mm,righttitle=5mm,
colbacktitle=yellow!20,coltitle=black,title=Box with interior raster,
colback=blue!10,clip upper]
\begin{tcbitemize}[raster columns=1,raster equal skip=0pt,
sharp corners,boxrule=0pt,
raster odd row/.style={empty},
raster even row/.style={tile,colback=red!10}]
\tcbitem
\lipsum[1]
\tcbitem
\lipsum[2]
\tcbitem
\lipsum[1]
\tcbitem
\lipsum[1]
\end{tcbitemize}
\end{tcolorbox}
\clearpage
The same with a new environment:
\newenvironment{mybox}{%
\begin{tcolorbox}[enhanced,
boxsep=0pt,top=0pt,bottom=0pt,leftupper=0pt,rightupper=0pt,
toptitle=1mm,bottomtitle=1mm,lefttitle=5mm,righttitle=5mm,
colbacktitle=yellow!20,coltitle=black,title=Box with interior raster,
colback=blue!10,clip upper]%
\begin{tcbitemize}[raster columns=1,raster equal skip=0pt,
sharp corners,boxrule=0pt,
raster odd row/.style={empty},
raster even row/.style={tile,colback=red!10}]%
}{\end{tcbitemize}\end{tcolorbox}}
\begin{mybox}
\tcbitem
\lipsum[1]
\tcbitem
\lipsum[2]
\tcbitem
\lipsum[1]
\tcbitem
\lipsum[1]
\end{mybox}
\end{document}
Best Answer
Any environment defined by
\newtcbtheorem
takes two arguments: the proposition name and the proposition label. Since you didn't specify the label, the parser gobbles the first letter as the label. Try using\begin{myprop}{Prop. name}{prop_label}
.Source:
tcolorbox
documentation.