Question: I am new to TCL Tk and I am using Tk table to create a table in my GUI.

```
Basically it contains some hardware register's info like its name, address, value....etc.
Now i want that user should not be able to change the register address and name and hence i   

```

want to disable the name and address column of Tk table completely. Can anybody tell me how i can to this. I am trying this from long time. Please help me .

Answer: 
Tk doesn't have a built in table widget, so I assume you're using the Tktable/Tile from [here](http://sourceforge.net/projects/tktable/).

Here is an example I threw together that disabled 2 of the columns. Basically you assign all of the entries that you want to edit with a certain tag by using -coltagcommand and a function, then you apply attributes like state to that tag.

```
package require Tktable

array set cells {
    0,0 David 0,1 "1234 Fake st" 0,2 foo
    1,0 John 1,1 "444 New York Ave" 1,2 bar
}

# This function returns the tag to assign to all cells in col $col
proc tagCol col {
    # If we're name or address column, add the disabledColumn tag to it
    if {$col == 0 || $col == 1} {
        return disabledColumn;
    }
}

table .mytable -rows 2 -cols 3 -variable cells -coltagcommand tagCol

# Disable editing of the disabled column entries
.mytable tag config disabledColumn -state disabled -fg blue

pack .mytable

```
you can also use any of options **-titlerows 'n'** and **-titlecols 'm'** to state that first 'n' rows are read only title, or first 'm' cols are read only title.

hope I helped