title: How to place table cells different way when orientation is horizontal in swift
body: <p>sorry to bother programmers again, <br>
  I'm writing a simple app, and one of the view controllers has a table.
  I'm new to all of this so I found some videos and programmed the table. This is the code above classes (honestly I still don't understand what it does):</p>
  <pre><code>    extension ViewController3: UITableViewDelegate {
      func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
          print(&quot;you tapped me!&quot;)
      }
  }
  extension ViewController3: UITableViewDataSource
  {
      func numberOfSections(in tableView: UITableView) -&gt; Int {
          return 1
      }
      func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {
          return names.count
      }
      func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&gt; UITableViewCell {
          let cell = tableView.dequeueReusableCell(withIdentifier: &quot;cell&quot;, for: indexPath)
          cell.textLabel?.text = names[indexPath.row]
          return cell
      }
  }
  </code></pre>
  <p>And this is the class:</p>
  <pre><code>class ViewController3: UIViewController {
      @IBOutlet var tView: UITableView!
      let names = [
      &quot;Alex&quot;,
      &quot;Andrew&quot;,
      &quot;Mary&quot;,
      &quot;Henry&quot;]
      override func viewDidLoad() {
          super.viewDidLoad()
          tView.delegate = self
          tView.dataSource = self
          
      }
  }
  </code></pre>
  <p>It works fine but the task is when the orientation of the phone/simulator is horizontal, to SHOW the table not in one row, but 2x2 (like 4 cells - 2 rows, 2 lines). I don't know where to search it, I found some tips about placing elements in this way but it's not for a table. And I don't know whether its possible or not. Thank you all in advance</p>