简体   繁体   English

单元格中的 HTML 竖排文本 + 导出到 excel

[英]HTML vertical text in cell + export to excel

I have try to do this once, but unsuccessfully, and now meet the same problem again.我曾经尝试过这样做,但没有成功,现在再次遇到同样的问题。

I have to generate HTML table with vertical text like this:我必须用这样的垂直文本生成 HTML 表格:

在此处输入图片说明

and this HTML should be valid(the same) in excel.并且此 HTML 在 excel 中应该是有效的(相同)。

Has anyone done this?有没有人做过这个?

Something more - I am not able to use images too.还有更多 - 我也不能使用图像。

It's possible with this css:这个css是可能的:

-webkit-transform: rotate(-90deg);
-moz-transform: rotate(-90deg);
-ms-transform: rotate(-90deg);
-o-transform: rotate(-90deg);
transform: rotate(-90deg);
mso-rotate: 90;
-webkit-transform-origin: 50% 50%;
-moz-transform-origin: 50% 50%;
-ms-transform-origin: 50% 50%;
-o-transform-origin: 50% 50%;
transform-origin: 50% 50%;
position: absolute;
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);

这不能仅使用 HTML 来完成。

The following property will do the job if you want to rotate your text:如果您想旋转文本,以下属性将完成这项工作:

<td style="mso-rotate:90;">I Rotate</td>

http://fabianmejia.blogspot.pe/2008/11/rotate-text-in-web-generated-excel-file.html http://fabianmejia.blogspot.pe/2008/11/rotate-text-in-web-generated-excel-file.html

<table>
         <td style="mso-rotate:90;">No</td>
         <td style="mso-rotate:90;">Name</td>
</table>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM