C# 表格以列为行

发布于 2024-12-04 07:40:55 字数 696 浏览 1 评论 0原文

我想知道 C# 中是否可以有一个表,允许其中一列显示为一行,因此每个记录实际上是两行。

我正在尝试创建一个文档搜索引擎。我希望文档属性(例如文档标题、创建日期)放入列中,并且在列中也包含文档的摘录,但是我觉得如果摘录位于新行上(类似于 google 的方式),会更合适显示带有页面摘录的结果。对于如何实现这一目标的任何建议,我将不胜感激。我目前正在考虑创建一个 jQuery 组件并以这种方式加载它,除非有更简单的方法?下面是我对表格外观的描述:

-----------------------------------------------
|Col 1 | col 2                 | col3         |
-----------------------------------------------
|Data  |         data          | data         |
|Contents of col4                             |
-----------------------------------------------
|Data  |         data          | data         |
|Contents of col4                             |
-----------------------------------------------

I am wondering if it is possible to have a table in C# which allows one of the columns to appear as a row so each record is effectively two rows.

I am attempting to create a search engine for documents. I would like document properties such as document title, date created to be put into columns and also have an extract of the document in a column as well however I feel it would be more appropriate if the extract was on a new line similar to how google displays results with a page extract. I will be grateful for any advice on how this could be achieved. I am currently considering creating a jQuery component and loading it in this way unless there are any easier methods? Below is a depiction of how I imagine the table to look:

-----------------------------------------------
|Col 1 | col 2                 | col3         |
-----------------------------------------------
|Data  |         data          | data         |
|Contents of col4                             |
-----------------------------------------------
|Data  |         data          | data         |
|Contents of col4                             |
-----------------------------------------------

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

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

发布评论

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

评论(1

念﹏祤嫣 2024-12-11 07:40:55

将“摘录”存储在数据库中其自己的列中(每一行都是一个“文档”)。然后,在您的视图中,您可以将其显示为 HTML 表中自己的行。不需要 jQuery。

Store the "extract" in it's own column in the database (each row is one "document"). Then, in your view, you can have it be displayed as it's own row in the HTML table. No need for jQuery.

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