Hello, The following code displays the correct data but I am unable to figure out how to format the tables headings , including font size and alignment. Any help in pointing me in the right direction will be appreciated.
Chris
struct SummaryTable: View {
private var localArray: [TradingDayPrices]
init(passedInArray: [TradingDayPrices]) {
self.localArray = passedInArray
}
var body: some View {
let funds: [Fund] = GetSummaryTable(localArray: localArray)
Table(funds) {
TableColumn("Index Fund") { value in
Text(value.name)
.padding(.vertical, 2)
}
.width(90)
TableColumn("Shares") { value in
HStack {
Spacer()
Text(value.shares)
Spacer()
}
}
.width(90)
TableColumn("Share Price") { value in
HStack {
Spacer()
Text(value.sharePrice)
Spacer()
}
}
.width(90)
TableColumn("Total") { value in
HStack {
Spacer()
Text(value.total)
}
}
.width(110)
TableColumn("One Year Gain") { value in
HStack {
Spacer()
Text(value.percentChange)
Spacer()
}
}
.width(90)
} // end table
.tableStyle(.inset(alternatesRowBackgrounds: true))
.padding([.leading, .trailing], 185)
.padding([.top], 30)
.padding([.bottom], 700)
}
}