1

I was looking for some built in functionality in SwiftUI for building a table with named columns in iOS. There appears to be a Table Function but it only works for macOS. Would the best way be to use a LazyVGrid, build the table up manually with VStacks and HStacks, or some other solution I'm unaware of here?

I can add code to show what I've tried doing if that helps.

Here's an example of the table described above. How would I create those columns and rows as shown?

enter image description here

4
  • Do you really want the date and numeric columns centered? Commented Oct 19, 2021 at 6:10
  • @JoakimDanielson I actually didn’t take that into account but it looks like that’s done automatically by SwiftUI? I was more interested in a building a table than where the elements were positioned in the “cells”. Did you have a suggestion or preference? Commented Oct 19, 2021 at 6:20
  • 1
    Well numbers should be right-justified and dates and text left-justified as a ground rule Commented Oct 19, 2021 at 6:33
  • @JoakimDanielson not helpful. The OP is asking a "how to" question. Function over form. Formatting questions can be addressed once the question has found a solution. Commented Feb 16, 2023 at 23:40

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.