I am trying to emulate a table (since it looks the...
# compose-desktop
y
I am trying to emulate a table (since it looks there is none) and I have the following code:
Copy code
Column {
        parts.value.forEach { part ->
            Row(modifier = Modifier.fillMaxWidth().background(color = Color.LightGray)) {
                Text(part.name, modifier = Modifier.fillMaxWidth(0.33333F).background(color = Color.Red))
                Text(part.description ?: "N/A", modifier = Modifier.fillMaxWidth(0.33333F).background(color = Color.Green))
                Text(part.price.toString(), modifier = Modifier.fillMaxWidth(0.33333F).background(color = Color.Blue))
            }
        }
    }
It renders this way so I guess I don't understand the fraction parameter...
z
it’s not terribly difficult to make a real table composable. Here’s an example.
r
You should also be able to achieve it with ConstraintLayout and barriers
y
I replaced .fillMaxWidth(0.333F) by .weight(1F) and it now works
s
@romainguy does ConstraintLayout work on compose desktop?
o
nope, ConstraintLayout is not ported to desktop, as relies on Android library
🙏 1
😅 1
r
@olonho Is that also true of the Compose version?
AFAIK it only uses the solver which is not Android specific (it’s used in the visual editor in the IDE)
o
It was mostly dependency management matter, IIRC and if we could bring it to Compose for Desktop - would be awesome