Im looking for a way to to show data in a “tabular” format on a DETAILS VIEW. I want to achieve something like this, but with everything lining up properly. Any ideas on whether this is possible, and how?
What you are seeing here is an image for the title bar, and 6 fields arranged in two columns of three, with the labels turned off on the right hand column. Its close - but this is the builder view. In the live app it looks like this …
I was hoping for a way to force everything back into line.
Hi Leigh
Try adding this
_style=[min-width: 200px, max-width: 200px], [ktlTarget, $('#${viewId} .kn-detail-label, #${viewId} .kn-detail-body')]
Adjust the widths as needed. Don’t replace viewId this should work as is.
Do it in 2 keywords if you want the label and the body to be different widths
Will only work with KTL. The same idea could also be done in CSS.
#view_123 .kn-detail-label,
#view_123 .kn-detail-body {
max-width: 200px;
min-width: 200px;
}
View_123 will need to be replaced with the view id of details view. You may need to add !important to these styles if it doesn’t initially work as Knack set the widths as inline styles.
Let me know if this works
Craig
1 Like
Thanks Craig, the KTL version works well - haven’t tried the CSS, no point since KTL works. Also using KTL to conditionally shade the risk rating.
I had to spread them out vertically a bit, because when you remove the label on a field, the field height decreases a bit - meaning that the rh column is a bit shorter than the lh column if you dont reset every row. But still looks good.
1 Like