Results 1 to 9 of 9
  1. #1
    Member MarkJH's Avatar
    Join Date
    January 18th, 2005
    Posts
    68
    I'm trying to display a table in an index page with two columns that display the first half of the results in the first column and the second half in the other.

    This is the nearest I have got. The following code displays the results in two columns but alternates the results between the columns.

    <pre class="ip-ubbcode-code-pre"> &lt;table border="0" cellpadding="2" cellspacing="3" width="620" bordercolor="#FFFFFF" bgcolor="#FFFFFF" align="left"&gt;
    [WM-Record]
    [WM-If IndexRecordNumber mod 2]
    &lt;td width="310" valign="top"&gt;&lt;font face="Verdana" size="2"&gt;[WM-Field: Widget target="_top"]&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
    [WM-Else]
    &lt;tr&gt;&lt;td width="310" valign="top"&gt;&lt;font face="Verdana" size="2"&gt;[WM-Field: Widget target="_top"]&lt;/font&gt;&lt;br&gt;&lt;/td&gt;
    [/WM-If]
    [/WM-Record]
    &lt;tr&gt;&lt;td&gt;&lt;p&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;
    &lt;/table&gt; </pre>

    For example:

    widget1 widget2
    widget3 widget4
    widget5 widget6
    widget7

    When I'm after:

    widget1 widget5
    widget2 widget6
    widget3 widget7
    widget4

    Any ideas where I'm going wrong?

  2. #2
    Full Member
    Join Date
    January 18th, 2005
    Posts
    413
    I don't think that you are doing anything wrong. I think that WM simply works in "rows" before "columns" as it puts data into a table.

    Have a Creative Day!
    FRANK, Baertracks
    Be More Creative

  3. #3
    Member MarkJH's Avatar
    Join Date
    January 18th, 2005
    Posts
    68
    This is what I thought. I couldn't see a possible workaround for this but I was hoping that somebody else could see something that I couldn't!

    Oh, well. 'tis a shame. Perhaps that's something that Richard could work on for the next update?

  4. #4
    Affiliate Manager
    Join Date
    January 18th, 2005
    Location
    Los Angeles, California
    Posts
    1,913
    <BLOCKQUOTE class="ip-ubbcode-quote"><font size="-1">quote:</font><HR>Originally posted by MarkJH:
    This is what I thought. I couldn't see a possible workaround for this but I was hoping that somebody else could see something that I couldn't!

    Oh, well. 'tis a shame. Perhaps that's something that Richard could work on for the next update?<HR></BLOCKQUOTE>

    Possibly, but it's counter to the natural order of cell contents in HTML. It would be a fair amount of work to do the juggling needed to build tables in an order other than the order they appear in the HTML source -- how important is this feature enhancement to you, and are there others here who need it?

    --
    Richard Gaskin
    Fourth World Media Corporation
    Developer of WebMerge: Publish any database on any site
    ___________________________________________________________
    Ambassador@FourthWorld.com http://www.FourthWorld.com
    Tel: 323-225-3717 AIM: FourthWorldInc

  5. #5
    Member MarkJH's Avatar
    Join Date
    January 18th, 2005
    Posts
    68
    In my current design, it is quite important. To be honest, if there was a command that allowed me to count the number of records to display and only display half in one table, and the second half in the other, that would be just as good.

    Really, if nobody else needs such a feature, I'll just redesign my index system.

  6. #6
    Full Member jollygoodpirate's Avatar
    Join Date
    January 18th, 2005
    Location
    NC
    Posts
    227
    I know nothing of the syntax of webmerge but you could do something like this:

    <pre class="ip-ubbcode-code-pre">
    &lt;tr&gt;&lt;td&gt;
    while (record):
    if record &lt; numberofrecords/2
    print record
    else if record = numberofrecords/2
    print &lt;/td&gt;&lt;td&gt;
    print record
    else
    print record
    print &lt;P&gt;
    endwhile
    &lt;/td&gt;&lt;/tr&gt;
    </pre>


    I don't know if this is clear but if you know how many records you have you can create a table with 2 columns, print all the items less than half on one column, then the rest in the second column, you only have one row with multiple items per column. Possible in webmerge, don't know.

  7. #7
    Member MarkJH's Avatar
    Join Date
    January 18th, 2005
    Posts
    68
    Jollygoodpirate, I've actually tried something similar already but to no avail. Unfortunately, there doesn't seem to be a command to give you the total number of records on an index page. If there was, I think it would be possible.

  8. #8
    Full Member jollygoodpirate's Avatar
    Join Date
    January 18th, 2005
    Location
    NC
    Posts
    227
    sorry to hear that... however
    if you know what order you want your records on a page... if you can sort your datafeed in the order you want, then webmerge will create the table as you want it. Pre process the feed first:

    Original:
    r1,r2,r3,r4,r5,r6,r7
    table
    r1 r2
    r3 r4
    r5 r6
    r7

    Order feed:
    r1,r5,r2,r6,r3,r7,r4
    table
    r1 r5
    r2 r6
    r3 r7
    r4

    It may be very difficult... but I am just trying to help you think laterally.

  9. #9
    Full Member
    Join Date
    January 18th, 2005
    Posts
    413
    =====================
    If you can sort your datafeed in the order you want, then webmerge will create the table as you want it.
    =====================

    Very clever (almost elegant!)

    And I don't think that this would be that difficult to implement. Once you decide on the number of rows, the "vertical pattern" to order the feed could be cut and paste throughout the feed (and resorted) without much work.

    Have a Creative Day!
    FRANK, Baertracks
    Be More Creative

  10. Newsletter Signup

+ Reply to Thread

Similar Threads

  1. Is this a good way to make "tables" or columns with divs?
    By Hardaka in forum Programming / Datafeeds / Tools
    Replies: 3
    Last Post: December 9th, 2007, 08:15 PM
  2. Creating 3 columns for products
    By jackson992 in forum Programming / Datafeeds / Tools
    Replies: 12
    Last Post: September 11th, 2006, 12:01 AM
  3. Tables and Columns
    By jwg in forum WebMerge (Fourthworld.com)
    Replies: 1
    Last Post: February 11th, 2005, 03:41 AM
  4. Tables problem
    By zimmy in forum WebMerge (Fourthworld.com)
    Replies: 26
    Last Post: May 26th, 2004, 09:20 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •