title: How to improve my code to show a data array in a table, with TornadoFX?
body: <p>This is my way to display an array of data:</p>
  
  <pre><code>private val data = observableArrayList(
          arrayOf("AAA", "111"),
          arrayOf("BBB", "222"),
          arrayOf("CCC", "333")
  )
  
  class HelloWorld : View() {
      override val root = tableview&lt;Array&lt;String&gt;&gt;(data) {
          column("name") { cellDataFeatures: TableColumn.CellDataFeatures&lt;Array&lt;String&gt;, String&gt; -&gt; 
              SimpleStringProperty(cellDataFeatures.value[0]) 
          }
          column("value") { cellDataFeatures: TableColumn.CellDataFeatures&lt;Array&lt;String&gt;, String&gt; -&gt; 
              SimpleStringProperty(cellDataFeatures.value[1]) 
          }
      }
  }
  </code></pre>
  
  <p>It works but the code is quite complex. Is there any better way to do it?</p>
  
  <p>(Maybe define a class to hold the data will make it much simpler, but I just want to test some uncommon cases)</p>
  
  <p>Update:</p>
  
  <p>A complete demo project for this: <a href="https://github.com/javafx-demos/tornadofx-tableview-array-data-demo" rel="nofollow noreferrer">https://github.com/javafx-demos/tornadofx-tableview-array-data-demo</a></p>