title: How do I add extra columns to this UITableView and populate with data already fetched?
body: <p>In the following code I fetch some data for a UITableView.</p>
  
  <p>Currently, the table shows one column of data 'homeTeam'.</p>
  
  <p>My desired output is to have multiple columns within the UITableView.</p>
  
  <p>I have fetched the arrays for the other columns which can be seen in the code below.</p>
  
  <pre><code>import UIKit
  
  class ShowResultsViewController: UIViewController, UITableViewDelegate, UITableViewDataSource {
  
  
  var personalPlayerId: String?
  var communityId: String?
  var personalPlayer2Id: String?
  var postString: String?
  
  var homeTeam = [String?]()
  var homePlayer = [String?]()
  var homeGoals = [String?]()
  
  var awayTeam = [String?]()
  var awayPlayer = [String?]()
  var awayGoals = [String?]()
  
  var matchId = [String?]()
  
  var tempResult: Int?
  
  var selectedMatch: String?
  
  var headToHead: Bool?
  
  @IBOutlet weak var leagueTableView: UITableView!
  
  override func viewDidLoad() {
      super.viewDidLoad()
  
  
  
      self.leagueTableView.delegate = self
      self.leagueTableView.dataSource = self
  
  
  }
  
  func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {
  
      return self.homeTeam.count
  }
  
  func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&gt; UITableViewCell {
  
      let title = self.homeTeam[indexPath.row]
      let cell = UITableViewCell()
  
      return cell
  
  }
  
  func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
  
      tempResult = indexPath.row
  
      if let tempShowResult = (self.homeTeam[tempResult!]){
          self.selectedMatch = tempShowResult
      }
  
  }
  
  override func viewDidAppear(_ animated: Bool) {
      let myUrl = URL(string: "http://www.???.uk/???/getLeagueResults.php")
      var request = URLRequest(url:myUrl!)
      request.httpMethod = "POST"
  
      if self.headToHead == true {
          self.postString = "player_id=\(self.personalPlayerId!)&amp;player2_id=\(personalPlayer2Id!)&amp;community_id=\(communityId!)";
      }else{
          if self.headToHead == false{
              self.postString = "player_id=\(self.personalPlayerId!)&amp;community_id=\(communityId!)";
          }
      }
  
      request.httpBody = self.postString?.data(using: String.Encoding.utf8);
      let task = URLSession.shared.dataTask(with: request) { (data: Data?, response: URLResponse?, error: Error?) in
          DispatchQueue.main.async
              {
                  do{
  
                      let json = try JSONSerialization.jsonObject(with: data!, options: .allowFragments) as? [String:AnyObject]
                      print (json!)
  
  
                          // GET DATA FOR TABLE COLUMNS
  
  
                              if let arr = json?["allPersonalLeagueStats"] as? [[String:String]] {
                                  self.homeTeam = arr.flatMap { $0["player1_team"]!}
                                  self.homePlayer = arr.flatMap { $0["player1_name"]!}
                                  self.homeGoals = arr.flatMap { $0["player1_goals"]!}
  
                                  self.awayTeam = arr.flatMap { $0["player2_team"]!}
                                  self.awayPlayer = arr.flatMap { $0["player2_name"]!}
                                  self.awayGoals = arr.flatMap { $0["player2_goals"]!}
  
                                  self.matchId = arr.flatMap { $0["results_id"]!}
                              }
  
  
                         self.leagueTableView.reloadData()
                      }
  
  
                  catch{
                      print(error)
                  }
          }
      }
      task.resume()
  
  
  }
  
  
  }
  </code></pre>
  
  <p>How do I add more columns to this table to show the extra columns; <code>home_player</code>, <code>home_goal</code>, <code>away_player</code>, <code>away_team</code>, <code>away_goals</code>?</p>
  
  <p>I would like the output to represent the following in a table:</p>
  
  <p><code>+---------------+---------+-------+-------+------------+--------------+
  | Bobby Charles | Man Utd |   2   |   3   |  Fiorentina| Andrew James |
  | Ryan Stood    | Arsenal |   0   |   1   |  Chelsea   | Bobby Charles|
  | Bobby Charles | Chelsea |   0   |   2   |  Liverpool | Ryan Stood   |
  +---------------+---------+-------+-------+------------+--------------+</code></p>