title: Modify and display abbreviated data in the table generated using D3
body: <p>I have a table generated using D3 and a json file <a href="https://jsonblob.com/api/2700cb25-fccc-11e6-a0ba-c7b961ce26a7" rel="nofollow noreferrer">ma_voteshare.json</a> based on the following tutorial <a href="http://bl.ocks.org/jfreels/6734025" rel="nofollow noreferrer">http://bl.ocks.org/jfreels/6734025</a>. The first column of the generated table displays party name and the other columns show the corresponding numbers (see example below). What I need is to display abbreviated version of the party data for example: Bharathiya Janatha Party as (BJP) and so on. How can I modify the specific party column data. I have attached the Json file.</p>
  
  <p><a href="https://i.stack.imgur.com/i13BJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/i13BJ.png" alt="enter image description here"></a></p>
  
  <pre><code>    d3.queue()
      .defer(d3.json, "https://jsonblob.com/api/2700cb25-fccc-11e6-a0ba-c7b961ce26a7")
      .await(ready)
  
  function ready (error, up) {
      if (error) throw error;
  
      function tabulate(data, columns, tableName) {
          console.log(columns[0]);
          var table = d3.select(tableName).append('table')
          var thead = table.append('thead')
          var tbody = table.append('tbody');
  
          // append the header row
          thead.append('tr')
             .selectAll('th')
             .data(columns).enter()
             .append('th')
             .text(function (column) {
                  return column;
              });
  
            // create a row for each object in the data
            var rows = tbody.selectAll('tr')
                .data(data)
                .enter()
                .append('tr')
  
            // create a cell in each row for each column
            var cells = rows.selectAll('td')
                .data(function (row) {
                    return columns.map(function (column) {
                        return {column: column, value: row[column]};
                    });
                 })
                 .enter()
                 .append('td')
                 .text(function (d) { return d.value; });
                     return table;
                  }
  
                // render the table(s)
      tabulate(up, ['party', 'won', 'leading', 'total'], 'div#jsontable-up');
  } // function ready
  </code></pre>