1

I make a lot of table in my tex file and I want to change all the table's background color to RGB{245,246,246}. Is there a way to change all the tables' background color to that? What should I do?

1 Answer 1

2

You can use \SetTblrInner command to make default settings:

\documentclass{article}
\usepackage{tabularray}
\usepackage{xcolor}
\definecolor{myback}{RGB}{245,246,246}
\SetTblrInner[tblr]{cells={bg=myback}}
\begin{document}

\begin{tblr}{hlines}
  Alpha & Beta \\
  Delta & Gamma
\end{tblr}

\bigskip

\begin{tblr}{hlines}
  Alpha & Beta \\
  Delta & Gamma
\end{tblr}

\end{document}

enter image description here

7
  • Hello, it is no use in talltblr environment. Why?
    – Y. zeng
    May 18, 2022 at 8:57
  • @Y.zeng Add \SetTblrInner[talltblr]{cells={bg=myback}} line. Please always give an minimal example in your question so that others know what you reallly want.
    – L.J.R.
    May 18, 2022 at 9:02
  • Is there a way to set tblr, talltblr and longtblr together? I tested these codes \SetTblrInner[talltblr,tblr,longtblr]{cells={bg=tablebackground}}, but failed.
    – Y. zeng
    May 18, 2022 at 9:04
  • @Y.zeng No at this time. But I am thinking to add \SetTblrInner*{<settings>} for changing settings of all tabularray environments to the package, see this issue github.com/lvjr/tabularray/issues/37
    – L.J.R.
    May 18, 2022 at 9:07
  • Thanks. Now I need to \SetTblrInner[tblr]{}, \SetTblrInner[talltblr]{} and \SetTblrInner[longtblr]{} seperately. Am I right?
    – Y. zeng
    May 18, 2022 at 9:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .