Dreamweaver:如何在不使用表格的情况下在单行中显示记录集
我是 Dreamweaver CS5 和 MySQL 用户,我正在尝试实现一个在线商店,客户可以在其中查看和购买图像或视频。我在 SQL 服务器上有一个表,用于跟踪有关图片的所有信息。即长度、格式、标题、专辑、价格等。我知道如何获取要显示的数据以及如何创建记录集并传递客户搜索/购物时所需的参数。
我的问题是...如何获取数据的结果或记录集以自定义格式而不是表格显示。例如,Dreamweaver 提供了动态表格来显示结果或动态文本。
Field A | Field B | Field C | Field D | Field E | Field F | Field G |
122 Orange 48 x 29 Color 19.99 Jones Photography picture.gif
上面就是Dreamweaver是如何实现的,以及我是如何知道数据可以显示的。 我如何显示它,如下所示:
Record 1 Record 2 Record 3 (Same format), and so on....
Field G (Picture.gif) Field G
Field A Field A
Field B Field B
Field C Field C
Field D Field D
Field E
如何以这种格式显示我的记录或结果?
I am a Dreamweaver CS5 and MySQL user, a I am trying to implement an online store where customers can view and buy images or video. I have a table on the SQL server that will keep track of all information about pictures. i.e., length, format, title, album, price, etc. I know how to get data to be displayed and how to create the recordset and pass parameters that are needed when the customers do their search / shopping.
My question is... How do I get the RESULTS of the data, or the Recordset to display in a custom format other than a table. For an example Dreamweaver provided dynamic tables to display results or dynamic text.
Field A | Field B | Field C | Field D | Field E | Field F | Field G |
122 Orange 48 x 29 Color 19.99 Jones Photography picture.gif
The above is how Dreamweaver, and how I know that data can be displayed.
How do I display it like this below:
Record 1 Record 2 Record 3 (Same format), and so on....
Field G (Picture.gif) Field G
Field A Field A
Field B Field B
Field C Field C
Field D Field D
Field E
How do I display my records or results in this format?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如下所示:
此代码的作用是循环遍历 DIV 标记,该标记包含“列”类型输出中记录集中每一行的输出。边框样式用于显示数据块的位置,根据需要删除/更新。
您可能会遇到列数对于内容区域来说太宽的问题,然后您可能希望将 CSS 选择器移至 float:left 而不是 display:inline-block。你可能会遇到列高的问题(当数据输出变化很大时,试图使 DIV 具有相同的高度(想想产品细节可能是一个短句子或二十个长段落),这将是一个需要单独提出的 CSS 问题(当然,或者首先搜索)
注意:即使记录集结果中没有行,默认的 Dreamwavqer 代码也会运行一次记录集循环代码,因此您需要使用 Show Region -> 来包装此代码。显示记录集是否不为空
Something like the following:
What this code does is to loop over a DIV tag that contains output for each row in the recordset in a "column" type of output. The border styling is to show where your data blocks are, remove/update as necessary.
You'll likely run into issues where the number of columns is too wide for you content area, and then you may want to move to float:left for the CSS selector rather than display:inline-block. And you may run into issues with column heights (trying to make DIV have the same height when the data output varies greatly (think product details that could be a single short sentence or twenty long paragraphs), that would be a CSS question to ask separately (or search first, of course).
Note: the default Dreamwavqer code will run through a recordset loop code once even if the recordset has no rows in the result, so you'll need to wrap this code with a Show Region -> Show If Recordset Is Not Empty