Perspective table column width resize issue

I am using a table but my dataset is not in array format

column data

when i try to resize a column.. its not working

how to fix the issue

this is how i passing data to table example script

a = [1,2,3]
b = ["good","bad","error"]
c = ["yes","no","none"]

headers =["a","b","c"]
data = []
i = 0
for i in range(0,3):
test = system.dataset.toDataSet(headers,data)
print test

or please let me know how to pass this in array format to table dataset

I believe you can still use column resizing with a dataset, are you using props.columns to declare the names/customization for each column? You can resize using the props.columns.width property:

Yes i tired its not working that's why posted this issue

Could you share a screenshot of what you have under the props.columns property?

1 Like

width also i changed

not working

Thank you. field is case-sensitive, could try using "TagPath" and "Unit" and "OPCPath"?

1 Like

Your props show fields of tagpath and unit, but those columns have different casing in your screenshot. The field prop must be a case-sensitive match to one of your Dataset columns in order for that config to work in the table.

Edit: I was looking at a later post and had forgotten about the screenshot present in the first post.


got it that's the issue
thanks for quick reply

Not related to the issue, but next time you need a small table for testing purpose, you can just build it like this instead:

data = [
    [1, "good", "yes"],
    [2, "bad", "no"],
    [3, "error", "none"],

Simpler than building it with loops, especially considering you're entering the values manually anyway.

Also, note that you don't need to declare and initialize your loop iterator variable before hand in python (you don't need i = 0 before the loop)