It is now possible to pass multiple border styles to a table border style by passing an array with selectors and colors.
Also added new convinience table border selectors for selecting the first row or every other inside border.
Here's an example:
MarkdownUI.Theme()
.table { configuration in
configuration.label
.markdownTableBackgroundStyle(.init(background: { row, column in
row == 0 ? .blue : .clear
}))
.markdownTableBorderStyle(
TableBorderStyle([ // <----- It is now possible to pass an array here.
.init(visibleBorders: .insideBordersFirstRow, color: .green),
.init(visibleBorders: .insideBordersExceptFirstRow, color: .red)
], strokeStyle: .init(lineWidth: 1))
)
.clipShape(RoundedRectangle(cornerRadius: 10, style: .continuous))
.overlay(
RoundedRectangle(cornerRadius: 10, style: .continuous)
.strokeBorder(.black, lineWidth: 1)
)
}
.tableCell { configuration in
configuration.label
.markdownTextStyle {
if configuration.row == 0 {
ForegroundColor(.white)
}
}
.padding(.vertical, 6)
.padding(.horizontal, 6)
}
It is now possible to pass multiple border styles to a table border style by passing an array with selectors and colors. Also added new convinience table border selectors for selecting the first row or every other inside border.
Here's an example: