How to fill in dotted lines
P粉757640504
P粉757640504 2023-09-15 15:37:13
0
1
499

Please help me solve this problem How to fill in a row of dots in the blank space between food name and price in reactjs? (picture example) I'm using Material UI library for my project, enter image description here

I'm using the Material UI library for my project

<Grid container spacing={2}>
      {coffeeMenu.map((item, index) => (
        <Grid item xs={6} key={index}>
          <Link
            underline='none'
            sx={{
              display: 'flex',
              flexDirection: 'row',
              justifyContent: 'space-between',
              alignItems: 'center',
              px: 5,
              fontWeight: 'bold',
              color: '#000',
              '&:hover': {
                color: '#D8AE78',
                cursor: 'pointer',
              },
            }}
          >
            <Typography>{item.name}</Typography>
            <Typography>{item.price}đ</Typography>
          </Link>
        </Grid>
      ))}
    </Grid>

P粉757640504
P粉757640504

reply all(1)
P粉741678385

You can add a div with a dotted border between the food name and price. I'd need to see your code to show you exactly how to do it, but something like this would work:

.container {
  width: 50%;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}

.food_name {
  margin-right: 20px;
}

.food_price {
  margin-left: 20px;
}

.dashed_line {
  flex: 1;
  border-top: 1px dashed black;
}
<div class="container">
  <p class="food_name">Hotdog</p>
  <div class="dashed_line"></div>
  <p class="food_price">.99</p>
</div>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template