#import "@preview/tablex:0.0.8": tablex, hlinex, vlinex, colspanx
#let nhead = 1;
#let nrow = 4;
#let ncol = 5;

#figure(
  
  kind: "tinytable",
  supplement: none,
  tablex(
    columns: ncol,
    header-rows: nhead,
    align: left + horizon,
    auto-lines: false,

hlinex(y: 0, start: 0, end: 5, stroke: 0.1em + black),
hlinex(y: 1, start: 0, end: 5, stroke: 0.05em + black),
hlinex(y: 5, start: 0, end: 5, stroke: 0.1em + black),
hlinex(y: 0, start: 0, end: 5, stroke: 0.1em + black),
hlinex(y: 1, start: 0, end: 5, stroke: 0.05em + black),
hlinex(y: 5, start: 0, end: 5, stroke: 0.1em + black),
    // tinytable lines before

    map-cells: cell => {

let i = (1,3,);
let j = (0,1,2,3,4,);

if (i.contains(cell.y) and j.contains(cell.x)) { cell.fill = rgb("#ededed") };
      // tinytable cell style before
      return cell;
    },

    // tinytable cell content after
[mpg], [cyl], [disp], [hp], [drat],
[21.0], [6], [160], [110], [3.90],
[21.0], [6], [160], [110], [3.90],
[22.8], [4], [108], [ 93], [3.85],
[21.4], [6], [258], [110], [3.08],

  ) // end tablex
) // end figure 
