Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 17th, 2008, 05:32 PM
Registered User
 
Join Date: Nov 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Dynamic tables

Hello All,

I've posted the question before, I'm having much trouble finding a solution for the following. I have an table in which I want to put records from a query. For each record I want to build the table with a max of 4 in a row, after the forth starting an new row.. The table has to be dynamicly build.
I found a lot of examples for single tables but none for the table I have in mind, that could be off course that it is impossible. But personally I thnk it could work. I just don't know how.

Is there anyone of you that can help me?
Thanks in advance..

Code:
<div align="center">
    <table border="0" cellpadding="0" style="border-collapse: collapse" width="168" id="table30">
        <tr>
            <td width="168">&nbsp;</td>
        </tr>
        <tr>
            <td width="168">
            <table border="0" cellpadding="0" style="border-collapse: collapse" width="150" id="table31">
                <tr>
                    <td height="100">
                    &nbsp;</td>
                </tr>
                <tr>
                    <td bgcolor="#A5A5A5" style="font-family: Arial Narrow; color: #FFFFFF; font-size: 12px; font-weight: bold; text-align: left; text-transform: uppercase" height="40">
                    <table border="0" cellpadding="0" style="border-collapse: collapse" width="100%" id="table35" height="100%">
                        <tr>
                            <td width="5">&nbsp;</td>
                            <td style="text-align: left; font-family: Arial Narrow; font-size: 12PX; text-transform: uppercase; color: #FFFFFF; font-weight: bold">
                            &nbsp;</td>
                        </tr>
                    </table>
                    </td>
                </tr>
            </table>
            </td>
        </tr>
        <tr>
            <td width="168">&nbsp;</td>
        </tr>
        </table>
</div>
 
Old November 17th, 2008, 06:07 PM
Friend of Wrox
 
Join Date: Jun 2008
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

Why do you want a separate <TABLE> for each record??? And then another <TABLE> inside of that, no less???

Haven't you heard that tables are passe? Time to move on to CSS based formats?

You don't show any ASP code to base my answer on, but in any case the basic code is simple enough.

*IF* I understand what you are after, something like this:
Code:
<div align="center">
<table border="0" cellpadding="0" style="border-collapse: collapse" width="168" id="table30">
<tr>


    <td colspan=4>&nbsp;</td>
</tr>
<%
Set RS = yourConnection.Execute( yourSqlQuery )
For Row = 1 To 999999 
    If RS.EOF Then Exit For ' quit when no more records
    Response.Write "<tr>" & vbNewLine ' start a new row   
    For Column = 1 To 4 ' as you asked for
        If RS.EOF Then Exit For ' quit when no more records
%>
    <td width="168">
        <table border="0" cellpadding="0" style="border-collapse: collapse" width="150" id="table31">
        <tr>

            <td height="100">&nbsp;</td>
        </tr>
        <tr>

            <td bgcolor="#A5A5A5" style="font-family: Arial Narrow; color: #FFFFFF; font-size: 12px; font-weight: bold; text-align: left; text-transform: uppercase" height="40">
                <table border="0" cellpadding="0" style="border-collapse: collapse" width="100%" id="table35" height="100%">
                <tr>

                    <td width="5">&nbsp;</td>
                    <td style="text-align: left; font-family: Arial Narrow; font-size: 12PX; text-transform: uppercase; color: #FFFFFF; font-weight: bold">
                            &nbsp;</td>
                </tr>
                </table>
            </td>
        </tr>
        </table>
    </td>
<%
        RS.MoveNext
    Next ' next column
    Response.Write "</TR>" & vbNewLine ' next outer row
Next ' next row
RS.Close
%>
<tr>


    <td colspan=4>&nbsp;</td>
</tr>
</table>
</div>
 
Old November 17th, 2008, 06:09 PM
Friend of Wrox
 
Join Date: Jun 2008
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

Really really seems strange to me that you are going to have rows with content that will be only
40 pixels high and then you are going to separate them by blank rows 100 pixels high. Weird.
 
Old November 17th, 2008, 07:06 PM
Friend of Wrox
 
Join Date: Jun 2008
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

I *have* to ask.

How come you use
     style="border-collapse: collapse"
when you don't have any borders to *be* collapsed??? You consistently use border=0, so what is the point??





Similar Threads
Thread Thread Starter Forum Replies Last Post
help writing dynamic form data to dynamic table ublend SQL Server ASP 1 June 1st, 2007 08:09 AM
help writing dynamic form data to dynamic table ublend Classic ASP Professional 1 June 1st, 2007 08:08 AM
Dynamic tables in DataSet melvik C# 9 September 26th, 2006 06:53 AM
Re: Dynamic html tables with xsl? purple XSLT 0 November 2nd, 2005 12:01 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.