0

I am using grid in semantic ui react and you are able to see in picture name and mob have padding i want to decrease these padding between them

Picture below

Code:

import React from 'react'
import { Grid, Image } from 'semantic-ui-react'

const GridExampleRows = () => (
  <Grid columns={2}>
    <Grid.Row>
      <Grid.Column>
        <span>Name</span>
      </Grid.Column>
      <Grid.Column>
        <span>: Arman</span>
      </Grid.Column>
    </Grid.Row>

    <Grid.Row>
      <Grid.Column>
        <span>Mob</span>
      </Grid.Column>
      <Grid.Column>
        <span>: 0987654321</span>
      </Grid.Column>
    </Grid.Row>
  </Grid>
)

export default GridExampleRows

1
  • what is your desired outcome? how much less padding do you want? Commented Jan 7, 2023 at 19:27

1 Answer 1

1

Perhaps try define inline styles with reduced padding, and apply to Grid.Row.

It seems that Image is also included as import but not used in posted example, so the styles value would possibly need to be further adjusted to be also fitting for Image.

Quick basic example: stackblitz

// 👇 Set top and bottom padding 3px, left and right 0px
const rowStyle = { padding: "3px 0px" };

const GridExampleRows = () => (
  <Grid columns={2}>
    <Grid.Row style={rowStyle}>
      <Grid.Column>
        <span>Name</span>
      </Grid.Column>
      <Grid.Column>
        <span>: Arman</span>
      </Grid.Column>
    </Grid.Row>

    <Grid.Row style={rowStyle}>
      <Grid.Column>
        <span>Mob</span>
      </Grid.Column>
      <Grid.Column>
        <span>: 0987654321</span>
      </Grid.Column>
    </Grid.Row>
  </Grid>
);

export default GridExampleRows;
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.