Search Unity

How to draw a multi colomn table using UIElements

Discussion in 'UIElements' started by NotGoodEnoughh, Sep 6, 2019.

  1. NotGoodEnoughh

    NotGoodEnoughh

    Joined:
    Feb 1, 2018
    Posts:
    35
    Hello! Can you say me how can I draw a table using UIElements?
    I saw a TreeView in UXML ref, but I can't find any helpful examples of its usage.
     
  2. hugobd

    hugobd

    Unity Technologies

    Joined:
    May 14, 2018
    Posts:
    15
    Hello!
    You'll have to be more precise on what you want to achieve. There's the ListView component that could be a good fit for your needs.

    You can take a look at [Window > UI > UIElements Samples] for examples.
     
    Last edited: Sep 6, 2019
  3. NotGoodEnoughh

    NotGoodEnoughh

    Joined:
    Feb 1, 2018
    Posts:
    35
    Thanks for reply! ListView isn't my variant.
    I need something like on the photo(without the treeview below the Name column)
    upload_2019-9-6_19-26-8.png
     
  4. hugobd

    hugobd

    Unity Technologies

    Joined:
    May 14, 2018
    Posts:
    15
    Hey! UIElements doesn't have a grid layout system yet. However, you could achieve the same result as your photo using a scrollView and a mixte of flex-direction column and row.

    Here's the doc for the layout engine: https://docs.unity3d.com/Manual/UIE-LayoutEngine.html