Column Headers with Underscore Case Data

29 of 124
ZingGrid autoformats headers for you by capitalizing and spacing your underscore case data keys.
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;
    }

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

<body class="zg-body">
  <zing-grid caption="EPL Top Scorers" layout-controls="disabled">
    <zg-data data='[
        {
          "player_name": "Eden Hazard",
          "player_club": "Chelsea",
          "goals_scored": 5          
        },
        {
          "player_name": "Aleksandar Mitrovic",
          "player_club": "Fulham",
          "goals_scored": 5   
        },
        {
          "player_name": "Sergio Agüero",
          "player_club": "Manchester City",
          "goals_scored": 4   
        },
        {
          "player_name": "Romelu Lukaku",
          "player_club": "Manchester United",
          "goals_scored": 4   
        },
        {
          "player_name": "Sadio Mané",
          "player_club": "Liverpool",
          "goals_scored": 4   
        }
      ]'></zg-data>
  </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="EPL Top Scorers"
      layout-controls="disabled">
      <zg-data 
        data='[
        {
          "player_name": "Eden Hazard",
          "player_club": "Chelsea",
          "goals_scored": 5          
        },
        {
          "player_name": "Aleksandar Mitrovic",
          "player_club": "Fulham",
          "goals_scored": 5   
        },
        {
          "player_name": "Sergio Agüero",
          "player_club": "Manchester City",
          "goals_scored": 4   
        },
        {
          "player_name": "Romelu Lukaku",
          "player_club": "Manchester United",
          "goals_scored": 4   
        },
        {
          "player_name": "Sadio Mané",
          "player_club": "Liverpool",
          "goals_scored": 4   
        }
      ]'></zg-data>
    </zing-grid>
  </body>
</html>
.zg-body {background:#e6e6e6;}
// 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