Tcl 如何在Tktable中将某些列设置为左对齐?

Tcl 如何在Tktable中将某些列设置为左对齐?,tcl,tk,Tcl,Tk,是否可以将某些列设置为左对齐?例如: package require Tktable table .table -rows 3 -cols 4 -titlerows 1 -titlecols 1 global TableValue array set TableValue {0,1 Title 0,2 Center_X 0,3 Width_X 1,0 1 2,0 2 \ 1,1 test1 1,2 0.5 1,3 0.2 2,1 test2 2,2 0.8 2,3 0.3} .table con

是否可以将某些列设置为左对齐?例如:

package require Tktable
table .table -rows 3 -cols 4 -titlerows 1 -titlecols 1
global TableValue
array set TableValue {0,1 Title 0,2 Center_X 0,3 Width_X 1,0 1 2,0 2 \
1,1 test1 1,2 0.5 1,3 0.2 2,1 test2 2,2 0.8 2,3 0.3}
.table configure -variable TableValue
pack .table
如果我只想将“中心X”和“宽度X”设置为左对齐,怎么做?
我已经尝试了“.table conifgure-anchor w”,这使得所有列都可以证明…

您必须使用标记。在你的例子中

.table tag col left 2 3
将指定的标记
left
添加到第2列和第3列(
Center_X
Width_X
)。然后

左派为他们辩护。如果希望标题居中,请添加

.table tag configure title -anchor c
title
是标题单元格的预定义标记)

.table tag configure title -anchor c