Coloque a tabela diretamente abaixo do título do exemplo

Coloque a tabela diretamente abaixo do título do exemplo

Neste momento, há uma mesa no espaço azul claro. Quero colocar esta tabela na caixa azul mais escura acima dela, logo abaixo do exemplo. Também não quero nenhum recuo. Isso é o que tenho até agora.insira a descrição da imagem aqui

\documentclass[a4paper,11pt,addpoints]{exam}
\usepackage[left=1.5cm,right=1.5cm,top=1.5cm,bottom=2cm]{geometry}

%noindent for whole doc
\setlength\parindent{0pt} 
%noindent for whole doc

%%%%%COLORS
\usepackage[dvipsnames]{xcolor}

%tables
\usepackage{tabularray}

%clour cells in table
\usepackage{nicematrix}

\usepackage{mathrsfs} 

%%%%%EXAMPLE BOX
\usepackage[most]{tcolorbox}
\usepackage{xcolor}
\usepackage{framed}
\usepackage{amssymb}
\tcbuselibrary{theorems}
\newtcbtheorem
  []% init options
  {Example}% name
  {\textcolor{black}{\textbf{Example}}}% title
  {%
    colback=cyan!5,
    colframe=cyan!40,
    fonttitle=\rmfamily,
    arc=0pt,
  }% options
  {exam}% prefix

%%%%%EXAMPLE BOX

\begin{document}

\begin{Example}{Complete the table and plot the points to sketch a line of the linear relationship, $y = x + 3$.
}{label}
 \begin{tblr}{colspec = {|X[1,c]|X[1,c]|X[1,c]|X[1,c]|X[1,c]|X[1,c]|X[1,c]|X[1,c]|},
cell{1}{1} = {yellow!40},
cell{2}{1} = {yellow!40},
}
    \hline
    $x$ & $-3$ & $-2$ & $-1$ & $0$ & 1 & 2 & 3 \\
    \hline
    $y$ & & & & &\\
    \hline
\end{tblr} 
  
\end{Example}

\end{document}

Tenho tido problemas ao tentar deixar o texto preto para que você possa ignorar isso se for estranho.

Responder1

Não tenho certeza se entendi sua pergunta.
Eu sugiro algo assim:

\documentclass[a4paper,11pt,addpoints]{exam}
\usepackage[left=1.5cm,right=1.5cm,top=1.5cm,bottom=2cm]{geometry}

%noindent for whole doc
\setlength\parindent{0pt} 
%noindent for whole doc

%%%%%COLORS
\usepackage[dvipsnames]{xcolor}

%tables
\usepackage{tabularray}

%clour cells in table
\usepackage{nicematrix}

\usepackage{mathrsfs} 

%%%%%EXAMPLE BOX
\usepackage[most]{tcolorbox}
\usepackage{xcolor}
\usepackage{framed}
\usepackage{amssymb}
\tcbuselibrary{theorems}
\newtcbtheorem
  []% init options
  {Example}% name
  {Example}% title
  {%
  theorem hanging indent=0pt,
    colback=cyan!5,
    colframe=cyan!40,
    fonttitle=\rmfamily,
    arc=0pt,
    coltitle=black,
    fonttitle=\bfseries,
    description font=\normalfont,
  }% options
  {exam}% prefix

%%%%%EXAMPLE BOX

\begin{document}

\begin{Example}{Complete the table and plot the points to sketch a line of the linear relationship, $y = x + 3$.\vspace{4pt}\newline
  \begin{tblr}{
    colspec = {*8{X[c]}},
    hlines, vlines,
    column{1} = {yellow!40},
    columns={mode=math},
    }
    x & -3 & -2 & -1 & 0 & 1 & 2 & 3 \\
    y &&&&&&&\\
  \end{tblr}
  }{label}

\end{Example}

\end{document}

insira a descrição da imagem aqui

informação relacionada