experiment_id: web-retrieval-v1
fixture_id: /demos/web-component-grid-layout-card
mode: provenance
representation: html
origin_response_id: 2ffa636c18c9962532f2f684bc3a00f5
version: 2026-10-21
version_created_at_utc: 2026-10-21T20:42:35.570Z
version_nonce: 277cc8fef57fca95ff70e2815f3347b3
generated_at_utc: 2026-11-08T23:26:24.756Z
response_nonce: e2a67d5815a1e93916cd86e901fe0baf

Card Layout

120 of 125
If you don't want ZingGrid to switch between layouts when you resize your screen, you can force a row layout with a layout="card" attribute on the <zing-grid> tag.
Result Full HTML CSS JS
Edit Download

Full Code

<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <title>ZingGrid: Simple Grid</title>
  <script nonce="undefined" src="https://cdn.zinggrid.com/zinggrid.min.js"></script>
  <style>
    .zg-body {
      background: #e6e6e6;
    }

    .headshot {
      max-width: 150px;
    }

    zing-grid[loading] {
      height: 419px;
    }
  </style>
</head>

<body class="zg-body">
  <zing-grid caption="Top LiverPool Forwards" layout="card" sort>
    <zg-data data='[
        {
          "firstName": "Alexander",
          "lastName": "Isak",
          "number": 9,
          "position": "Forward",
          "playerImg": "https://storage.googleapis.com/zinggrid-pwa.appspot.com/liverpool_roster_2026/alexander-isak.jpg"
        },
        {
          "firstName": "Federico",
          "lastName": "Chiesa",
          "number": 14,
          "position": "Forward",
          "playerImg": "https://storage.googleapis.com/zinggrid-pwa.appspot.com/liverpool_roster_2026/federico-chiesa.jpg"
        },
        {
          "firstName": "Cody",
          "lastName": "Gakpo",
          "number": 18,
          "position": "Forward",
          "playerImg": "https://storage.googleapis.com/zinggrid-pwa.appspot.com/liverpool_roster_2026/cody-gakpo.jpg"
        },
        {
          "firstName": "Hugo",
          "lastName": "Ekitike",
          "number": 22,
          "position": "Forward",
          "playerImg": "https://storage.googleapis.com/zinggrid-pwa.appspot.com/liverpool_roster_2026/hugo-ekitike.jpg"
        },
        {
          "firstName": "Rio",
          "lastName": "Ngumoha",
          "number": 73,
          "position": "Forward",
          "playerImg": "https://storage.googleapis.com/zinggrid-pwa.appspot.com/liverpool_roster_2026/rio-ngumoha.jpg"
        }
      ]'></zg-data>
    <zg-colgroup>
      <zg-column index="playerImg" header=" " width="100" sort="disabled" cell-class="headshot" type="image" type-image-mask="circle" type-image-alt="Player Img N/A"></zg-column>
      <zg-column index="firstName, lastName" header="Name">
        <template>
          [[index.firstName]] [[index.lastName]]
        </template>
      </zg-column>
      <zg-column index="number"></zg-column>
      <zg-column index="position" sort="disabled"></zg-column>
    </zg-colgroup>
  </zing-grid>
  <script>
    ZingGrid.setLicense(['26ccbfec16b8be9ee98c7d57bee6e498']);
  </script>
</body>

</html>
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>ZingGrid: Simple Grid</title>
    <script src="https://cdn.zinggrid.com/zinggrid.min.js"></script>
  </head>
  <body class="zg-body">
    <zing-grid
      caption="Top LiverPool Forwards"
      layout="card"
      sort>
      <zg-data data='[
        {
          "firstName": "Alexander",
          "lastName": "Isak",
          "number": 9,
          "position": "Forward",
          "playerImg": "https://storage.googleapis.com/zinggrid-pwa.appspot.com/liverpool_roster_2026/alexander-isak.jpg"
        },
        {
          "firstName": "Federico",
          "lastName": "Chiesa",
          "number": 14,
          "position": "Forward",
          "playerImg": "https://storage.googleapis.com/zinggrid-pwa.appspot.com/liverpool_roster_2026/federico-chiesa.jpg"
        },
        {
          "firstName": "Cody",
          "lastName": "Gakpo",
          "number": 18,
          "position": "Forward",
          "playerImg": "https://storage.googleapis.com/zinggrid-pwa.appspot.com/liverpool_roster_2026/cody-gakpo.jpg"
        },
        {
          "firstName": "Hugo",
          "lastName": "Ekitike",
          "number": 22,
          "position": "Forward",
          "playerImg": "https://storage.googleapis.com/zinggrid-pwa.appspot.com/liverpool_roster_2026/hugo-ekitike.jpg"
        },
        {
          "firstName": "Rio",
          "lastName": "Ngumoha",
          "number": 73,
          "position": "Forward",
          "playerImg": "https://storage.googleapis.com/zinggrid-pwa.appspot.com/liverpool_roster_2026/rio-ngumoha.jpg"
        }
      ]'></zg-data>
      <zg-colgroup>
        <zg-column 
        	index="playerImg"
          header=" "
          width="100"
          sort="disabled"
          cell-class="headshot"
          type="image"
          type-image-mask="circle"
          type-image-alt="Player Img N/A"></zg-column>
        <zg-column index="firstName, lastName" header="Name">
        	<template>
          	[[index.firstName]] [[index.lastName]]
          </template>
        </zg-column>
        <zg-column index="number"></zg-column>
        <zg-column index="position" sort="disabled"></zg-column>
      </zg-colgroup>
    </zing-grid>
  </body>
</html>
.zg-body {background:#e6e6e6;}

.headshot { max-width:150px; }
// No JS code

Interested in this demo? Modify it to your needs in ZingSoft Studio, our testing sandbox. It's free to sign up, and you can come back and edit at any time!

Edit in Studio

Demo Gallery