Override Column Headers

101 of 123
You can put whatever header text you want inside of the header attribute.
Result Full HTML CSS JS
Edit Download

Full Code

<!DOCTYPE html>
<html>

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

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

<body>
  <zing-grid caption="EPL Top Scorers" layout="row" layout-controls="disabled" viewport-stop>
    <zg-data data='[
        {
          "playerName": "Eden Hazard",
          "playerClub": "Chelsea",
          "goalsScored": 5          
        },
        {
          "playerName": "Aleksandar Mitrovic",
          "playerClub": "Fulham",
          "goalsScored": 5   
        },
        {
          "playerName": "Sergio Agüero",
          "playerClub": "Manchester City",
          "goalsScored": 4   
        },
        {
          "playerName": "Romelu Lukaku",
          "playerClub": "Manchester United",
          "goalsScored": 4   
        },
        {
          "playerName": "Sadio Mané",
          "playerClub": "Liverpool",
          "goalsScored": 4   
        }
      ]'></zg-data>
    <zg-colgroup>
      <zg-column index="playerName" header="Player"></zg-column>
      <zg-column index="playerClub" header="Club"></zg-column>
      <zg-column index="goalsScored" header="Goals"></zg-column>
    </zg-colgroup>
  </zing-grid>
  <script></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" defer></script>
  </head>
  <body>
    <zing-grid 
      caption="EPL Top Scorers"
      layout="row"
      layout-controls="disabled"
      viewport-stop>
      <zg-data 
        data='[
        {
          "playerName": "Eden Hazard",
          "playerClub": "Chelsea",
          "goalsScored": 5          
        },
        {
          "playerName": "Aleksandar Mitrovic",
          "playerClub": "Fulham",
          "goalsScored": 5   
        },
        {
          "playerName": "Sergio Agüero",
          "playerClub": "Manchester City",
          "goalsScored": 4   
        },
        {
          "playerName": "Romelu Lukaku",
          "playerClub": "Manchester United",
          "goalsScored": 4   
        },
        {
          "playerName": "Sadio Mané",
          "playerClub": "Liverpool",
          "goalsScored": 4   
        }
      ]'></zg-data>
      <zg-colgroup>
        <zg-column index="playerName" header="Player"></zg-column>
        <zg-column index="playerClub" header="Club"></zg-column>
        <zg-column index="goalsScored" header="Goals"></zg-column>
      </zg-colgroup>
    </zing-grid>
  </body>
</html>
body{background:#e6e6e6;}

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