Column Headers with Underscore Case Data

27 of 123
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 src="https://cdn.zinggrid.com/zinggrid.min.js" defer></script>
  <style>
    .zg-body {
      background: #e6e6e6;
    }

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

<body class="zg-body">
  <zing-grid caption="EPL Top Scorers" layout="row" layout-controls="disabled" viewport-stop>
    <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></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 class="zg-body">
    <zing-grid 
      caption="EPL Top Scorers"
      layout="row"
      layout-controls="disabled"
      viewport-stop>
      <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;}

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