---
title: "Extjs - How to set items margins and paddings?"  
description: "Extjs - How to set items margins and paddings?"  
author: "Anonymous User"  
published: 2016-05-04  
updated: 2016-05-13  
canonical: https://www.mindstick.com/forum/34126/extjs-how-to-set-items-margins-and-paddings  
category: "sencha extjs"  
tags: ["javascript", "sencha", "sencha cmd"]  
reading_time: 1 minute  

---

# Extjs - How to set items margins and paddings?

I am new in [ExtJS](https://www.mindstick.com/forum/34106/how-to-use-extjs-grid) environment. My [problem](https://yourviews.mindstick.com/view/81399/tackling-the-problem-of-unemployment-during-corona-pandemic) is how can I set magins and paddings in our form.Below I have provided my [code](https://yourviews.mindstick.com/view/85458/alan-turing-the-mastermind-behind-cracking-the-enigma-code-during-world-war-ii): I have created a [panel](https://www.mindstick.com/blog/11988/restructuring-corporate-offenses-government-appointed-panel-suggests-in-house-adjudication-system) with some [items](https://www.mindstick.com/forum/33812/getting-number-of-items-selected-in-uicollectionview-in-ios) :

```
{
    xtype: 'panel',
    margin: '20px;' // this margin is not working for me
    items: [
         {
            boxLabel: 'First Check',
            xtype: 'checkbox'
         }, {
            boxLabel: 'Second Check',
            xtype: 'checkbox'
         }]
}
```

I tried using margins and padding but none of them is working for me.\
Please provide me the solution. Thank you.

## Replies

### Reply by Tarun Kumar

You can set the margin and padding of the panel using the bodyStyle: property. In the bodyStyle property we can define both of them together. below I have provided an example on your code:\

```
{    xtype: 'panel',    bodyStyle: 'margin: 10px; padding: 10px 5px;',    items: [         {            boxLabel: 'First Check',            xtype: 'checkbox'         }, {            boxLabel: 'Second Check',            xtype: 'checkbox'         }]}
```

I hope it will be helpful for you.


---

Original Source: https://www.mindstick.com/forum/34126/extjs-how-to-set-items-margins-and-paddings

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
