# Make a table's cell editable conditionally

**URL:** <https://forum.inductiveautomation.com/t/make-a-tables-cell-editable-conditionally/86968>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [March 7, 2024, 1:26pm UTC](https://forum.inductiveautomation.com/t/make-a-tables-cell-editable-conditionally/86968 "2024-03-07T13:26:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ajay\_Gupta](https://avatars.discourse-cdn.com/v4/letter/a/f05b48/32.png) [@Ajay\_Gupta](https://forum.inductiveautomation.com/u/Ajay_Gupta)\
**Post date:** [March 7, 2024, 1:26pm UTC](https://forum.inductiveautomation.com/t/make-a-tables-cell-editable-conditionally/86968/1 "2024-03-07T13:26:26Z")

</div>

Hi,  
Is it possible to make a certain cell in a table editable or non-editable based on certain condition?  
Ex:- If I have a table which has 5 row and 5 cols. I want to check if cell at row #3, Col#2 has a particular value, then make it non-editable.  
Condition in just an example.

Thanks,  
Ajay

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [March 7, 2024, 4:38pm UTC](https://forum.inductiveautomation.com/t/make-a-tables-cell-editable-conditionally/86968/2 "2024-03-07T16:38:56Z")

</div>

Yes, you can.

The docs provide this example, where this specific cell is editable:

```json
city: {
   value: 'Folsom',
   editable: true,
   style: {
     backgroundColor: 'grey',
     classes: [] |''
   }
} 

```

Pay careful attention to the structure of this cell, as it belongs to a greater row entry, likely something like this:

```json
{
    country: 'United States',
    city: {
       value: 'Folsom',
       editable: true, # json bool is lower-case
       style: {
         backgroundColor: 'grey',
         classes: ''
       },
    population: 85000
} 

```

Notice that not every cell needs to have this same structure, though a homogenous approach/structure to your cells would really only benefit you in the long run.

You would need to provide this structure as you provide your data to the Table. This is most often done within a transform as part of your binding.

```python
# assuming a list of flat objects
for row in value:
    if row["MyColumn"] == "ValueMayNotBeEdited":
        row["MyColumn"] = {"value": row["MyColumn"], "editable": False}
return value

```

---

<div class="post-metadata">

**Author:** ![drewdin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/drewdin/32/3363_2.png) [@drewdin](https://forum.inductiveautomation.com/u/drewdin)\
**Post date:** [June 23, 2024, 2:47am UTC](https://forum.inductiveautomation.com/t/make-a-tables-cell-editable-conditionally/86968/3 "2024-06-23T02:47:41Z")

</div>

Sorry if I am misunderstanding but we don't have to modify the columns settings, we can add an editable:false to the data?

I guess I can just try it out but I am trying to save some work. thanks

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [June 23, 2024, 12:41pm UTC](https://forum.inductiveautomation.com/t/make-a-tables-cell-editable-conditionally/86968/4 "2024-06-23T12:41:25Z")

</div>

The columns settings apply to the whole column. You want "per cell".

---

<div class="post-metadata">

**Author:** ![drewdin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/drewdin/32/3363_2.png) [@drewdin](https://forum.inductiveautomation.com/u/drewdin)\
**Post date:** [June 23, 2024, 5:11pm UTC](https://forum.inductiveautomation.com/t/make-a-tables-cell-editable-conditionally/86968/5 "2024-06-23T17:11:00Z")

</div>

Thanks, I tried it out after the post and it worked.
