在控件和 Excel 中复制和粘贴时,对应的样式信息也将会随之附上。
使用 allowCopyPasteExcelStyle 属性来设置是否在复制粘贴的时候附加样式信息。
比如: (spread.options.allowCopyPasteExcelStyle = true;)。
复制和粘贴时的样式也会随着浏览器的不同而不同。
下表展示了从 Excel 复制数据到 Spread.Sheets 时,样式的不同之处。
Google Chrome | Mozilla Firefox | Microsoft Edge | Microsoft Internet Explorer | Safari on Mac | Chrome on Mac | |
backColor | 支持 | 支持 | 支持 | 支持 | ||
foreColor | 支持 | 支持 | 支持 | 支持 | ||
font | 支持 | 支持 | 支持 | 支持 | ||
vAlign | top -> top center -> center bottom -> bottom justify -> bottom distributed -> bottom | top -> center center -> center bottom -> center justify -> center distributed -> center | top -> top center -> center bottom -> bottom justify -> bottom distributed -> bottom | top -> top center -> center bottom -> bottom justify -> bottom distributed -> bottom | ||
hAlign | left -> left center -> center right -> right general -> general fill -> general justify -> general center across selection -> general distributed -> general | left -> left center -> left right -> left general -> left fill -> left justify -> left center across selection -> center distributed -> left | left -> left center -> center right -> right general -> general fill -> general justify -> general center across selection -> general distributed -> general | left -> left center -> center right -> right general -> general fill -> general justify -> general center across selection -> general distributed -> general | ||
borderLeft | thin -> medium medium -> medium dashed -> mediumDashed dotted -> dotted thick -> medium double -> double hair -> None mediumDashed -> mediumDashed dashDot -> None mediumDashDot -> None dashDotDot -> None mediumDashDotDot -> None slantedDashDot -> None | thin -> medium medium -> medium dashed -> mediumDashed dotted -> dotted thick -> medium double -> double hair -> None mediumDashed -> mediumDashed dashDot -> None mediumDashDot -> None dashDotDot -> None mediumDashDotDot -> None slantedDashDot -> None | thin -> medium medium -> medium dashed -> mediumDashed dotted -> dotted thick -> medium double -> double hair -> None mediumDashed -> mediumDashed dashDot -> None mediumDashDot -> None dashDotDot -> None mediumDashDotDot -> None slantedDashDot -> None | thin -> medium medium -> medium dashed -> mediumDashed dotted -> dotted thick -> medium double -> double hair -> None mediumDashed -> mediumDashed dashDot -> None mediumDashDot -> None dashDotDot -> None mediumDashDotDot -> None slantedDashDot -> None | ||
borderRight | ||||||
borderTop | ||||||
borderBottom | ||||||
textDecoration | strikethrough -> lineThrough single -> underline double -> underline single accounting -> underline double accounting -> underline | strikethrough -> lineThrough single -> underline double -> underline single accounting -> underline double accounting -> underline | strikethrough -> lineThrough single -> underline double -> underline single accounting -> underline double accounting -> underline | strikethrough -> lineThrough single -> underline double -> underline single accounting -> underline double accounting -> underline |
下表展示了从 Spread.Sheets 复制数据到 Excel 时,样式的不同之处。
Chrome | Firefox | Edge | Internet Explorer | Safari on Mac | Chrome on Mac | |
backColor | 支持 | 支持 | 不支持 | 不支持 | ||
foreColor | 支持 | 支持 | 不支持 | 支持 | ||
font | 支持 | 支持 | 不支持 | 支持 | ||
vAlign | top -> top center -> center bottom -> bottom | top -> top center -> center bottom -> bottom | 不支持 | 不支持 | ||
hAlign | left -> left center -> center right -> right general -> general | left -> left center -> center right -> right general -> general | 不支持 | 不支持 | ||
borderLeft | thin -> medium medium -> medium dashed -> mediumDashed dotted -> dotted thick -> medium double -> double hair -> dotted mediumDashed -> mediumDashed dashDot -> mediumDashed mediumDashDot -> mediumDashed dashDotDot -> mediumDashed mediumDashDotDot -> mediumDashed slantedDashDot -> mediumDashed | thin -> medium medium -> medium dashed -> mediumDashed dotted -> dotted thick -> medium double -> double hair -> dotted mediumDashed -> mediumDashed dashDot -> mediumDashed mediumDashDot -> mediumDashed dashDotDot -> mediumDashed mediumDashDotDot -> mediumDashed slantedDashDot -> mediumDashed | 不支持 | 不支持 | ||
borderRight | ||||||
borderTop | ||||||
borderBottom | ||||||
textDecoration | underline -> single lineThrough -> strikethrough overline -> None | underline -> single lineThrough -> strikethrough overline -> None | 不支持 | underline -> single lineThrough -> strikethrough overline -> None |
另见
Using Clipboard Operations
options Field