CSV 文件和多行文本单元格

发布于 2024-08-17 03:08:22 字数 263 浏览 5 评论 0原文

我正在使用 php 生成一个简单的 csv 文件。该文件包含一些用户的个人数据。 当我在 Office 中打开生成的文件时,地址不会以全高显示。我必须双击单元格才能完整显示地址(以全宽和全高),否则我只能看到地址的第一个单词/数字。 另外,我的出生日期显示为######,我必须展开整个列才能完全看到它们。

这在开放式办公室中不会发生。

有没有办法强制 MS Office 完整显示所有字段?因为否则对于使用它的人来说将会感到困惑(嘿所有细节在哪里!:)

谢谢:)

I am generating a simple csv file using php. The file contains some user's personal data.
When I open the generated file in office, the addresses are not displayed in full height. I have to double click on the cell for the address to be shown fully (in full width and height) otherwise I can only see the first word/number of the address.
Also, I have date of births displayed as ######, I have to expand the whole column to see them fully.

This doesn't happen in open office.

Is there any way to force MS Office to show all fields in full? Because otherwise it'll be to confusing for the people who will use (Hey where are all the details!:)

Thanks :)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

陌上青苔 2024-08-24 03:08:22

我不认为你可以用 CSV 来“格式化”你的工作表。您必须生成 Excel 可以理解的其他文件格式。我建议使用 XML,它非常容易生成。
只需使用所需数据制作一个示例表,将其另存为 XML,您就会看到如何生成文件。
或者,如果您不厌其烦地分析 XML 文件,则可以使用一些现成的 PHP 解决方案来编写 Excel 文件。

I don't think you can "format" your sheets with CSV. You will have to produce some other file format that Excel understands. I would suggest XML which is really easy to generate.
Just make a sample sheet with the data you want, save it as XML and you'll see how your file should be generated.
Or you could use some ready-made PHP solution for writing excel files if you can't be bothered with analysing the XML file.

紅太極 2024-08-24 03:08:22

您可以尝试自动调整列大小功能。

you could try the auto-size columns feature.

北渚 2024-08-24 03:08:22

这是 Excel 工作方式的 UI 问题,您不能强迫 Excel 或其他任何东西如何处理它。

最快的解决方法可能是创建一个 XLS 文件,该文件运行宏来检索 CVS 文件并根据需要格式化单元格,但您无法在 CSV 中执行任何操作来影响 Excel 显示的内容。

This is a UI issue with how Excel works, you can't force Excel or anything else how they handle it.

The quickest work around is to perhaps create an XLS file that runs a macro to retrieve the CVS file and format the cells as needed, but there's nothing you can do inside the CSV to affect what Excel is displaying.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文