Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个DataTable来自 Access 数据库的数据,需要以<textarea>制表符分隔的文本显示。我的第一个想法只是使用 aRepeater并使用ItemTemplate来格式化行,但问题是 Visual Studio 会自动将制表符转换为一组普通空格。有没有办法解决这个问题?还是有更好的方法来实现这一目标?
DataTable
<textarea>
Repeater
ItemTemplate
将您的文本区域设置为 runat server 并在您后面的代码中创建一个具有固定宽度列的字符串作为内容。查看 padleft 和 padright。
在任何情况下,HTML 渲染器几乎肯定会在客户端将制表符转换为空格。
复制并粘贴到大多数电子表格应用程序中的 HTML 表格会自动转换单元格,因此这取决于您要实现的目标。