回复 1楼xiaopanghai的帖子
xiaopanghai 你好,
可以使用 TextCellType 实现该功能,代码如下:
CSS:
- <style type="text/css">
- .test
- {
- text-align:center;
- }
- </style>
复制代码 C#:
- protected void Page_Load(object sender, EventArgs e)
- {
- if (IsPostBack)
- {
- return;
- }
- FarPoint.Web.Spread.TextCellType text = new FarPoint.Web.Spread.TextCellType();
- text.CssClass = "test";
- text.AllowWrap = true;
- text.Multiline = true;
- string s = "This is a test for multiline";
- this.FpSpread1.Sheets[0].Cells[0, 0].CellType = text;
- this.FpSpread1.Sheets[0].Cells[0, 0].Text = s;
- }
复制代码 |