Luckysheet icon indicating copy to clipboard operation
Luckysheet copied to clipboard

[Feature request]API to achieve the effect of automatic column width API实现自动列宽的效果

Open dream-num opened this issue 4 years ago • 4 comments

Describe the solution you'd like

API to achieve the effect of automatic column width

#zh API实现自动列宽的效果,扩展setColumnWidth即可

//设置第一列宽度为自适应,第二列宽度为60px
luckysheet.setColumnWidth({0:"auto",1:60})

//设置第一行高度为自适应,第二行高度为60px
luckysheet.setRowHeight({0:"auto",1:60})

dream-num avatar Dec 30 '20 08:12 dream-num

包括初始化的时候设置,这两个参数现在只支持数字,增加一个“auto”就好了

注意点:并且,设置了自动列宽"auto"的列,如果这一列所有单元格计算下来发现列宽小于默认列宽,那就取默认的列宽

image

dream-num avatar Jan 04 '21 03:01 dream-num

自动列宽与自动行高是否应该有一个优先级?因为计算内容的时候行高和列宽会相互影响。

hiyizi avatar Apr 15 '21 06:04 hiyizi

image 怎样让文字超出隐藏的单元格高度自适应

MC-YCY avatar Nov 04 '21 09:11 MC-YCY

image 怎样让文字超出隐藏的单元格高度自适应

解决没?

ghostcode avatar May 11 '22 14:05 ghostcode