This is Interesting: Free Magazines for Graphics designers and webmasters
Home > Archive > Dreamweaver > February 2006 > Alternating row colours in a repeat region?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Alternating row colours in a repeat region?
|
|
|
| I've gotten this working in IE6, but IE mac doesn't like it - does anyone know
any fixes?
The code is :
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="Connections/connPhotos.asp" -->
<%
Dim Recordset1
Dim Recordset1_numRows
Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_connPhotos_STRING
Recordset1.Source = "SELECT * FROM ORDER BY FerryRoute ASC"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()
Recordset1_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = 10
Repeat1__index = 0
Recordset1_numRows = Recordset1_numRows + Repeat1__numRows
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>row test</title>
<style type="text/css">
<!--
.row1 {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
font-style: normal;
background-color: #FFFFFF;
height: auto;
width: auto;
color: #333333;
}
.row2 {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
font-style: normal;
background-color: #EBF2FE;
}
-->
</style>
</head>
<body>
<table width="90%" border="0" cellspacing="0" cellpadding="0">
<%
While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF))
%>
<tr class="
<%
If counter=1 Then
Response.Write("row1")
counter=0
Else
Response.Write("row2")
counter=1
End If
%>"
>
<td><%=(Recordset1.Fields.Item("FerryRoute").Value)%></td>
</tr>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
Recordset1.MoveNext()
Wend
%>
</table>
</body>
</html>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>
Cheers,
Iain
| |
| Murray *TMM* 2006-02-12, 6:29 pm |
| The only thing I can see that would be unusual is the height/width
assignment of auto. What happens if you remove them?
--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================
"dukla" <webforumsuser@macromedia.com> wrote in message
news:dscpq9$rsd$1@forums.macromedia.com...
> I've gotten this working in IE6, but IE mac doesn't like it - does anyone
> know
> any fixes?
>
> The code is :
>
> <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
> <!--#include file="Connections/connPhotos.asp" -->
> <%
> Dim Recordset1
> Dim Recordset1_numRows
>
> Set Recordset1 = Server.CreateObject("ADODB.Recordset")
> Recordset1.ActiveConnection = MM_connPhotos_STRING
> Recordset1.Source = "SELECT * FROM ORDER BY FerryRoute ASC"
> Recordset1.CursorType = 0
> Recordset1.CursorLocation = 2
> Recordset1.LockType = 1
> Recordset1.Open()
>
> Recordset1_numRows = 0
> %>
> <%
> Dim Repeat1__numRows
> Dim Repeat1__index
>
> Repeat1__numRows = 10
> Repeat1__index = 0
> Recordset1_numRows = Recordset1_numRows + Repeat1__numRows
> %>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
> "http://www.w3.org/TR/html4/loose.dtd">
> <html>
> <head>
> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
> <title>row test</title>
> <style type="text/css">
> <!--
> .row1 {
> font-family: Arial, Helvetica, sans-serif;
> font-size: 12px;
> font-style: normal;
> background-color: #FFFFFF;
> height: auto;
> width: auto;
> color: #333333;
> }
> .row2 {
> font-family: Arial, Helvetica, sans-serif;
> font-size: 12px;
> font-style: normal;
> background-color: #EBF2FE;
> }
> -->
> </style>
> </head>
>
> <body>
>
> <table width="90%" border="0" cellspacing="0" cellpadding="0">
>
> <%
> While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF))
> %>
>
> <tr class="
> <%
> If counter=1 Then
> Response.Write("row1")
> counter=0
> Else
> Response.Write("row2")
> counter=1
> End If
> %>"
> <td><%=(Recordset1.Fields.Item("FerryRoute").Value)%></td>
> </tr>
>
> <%
> Repeat1__index=Repeat1__index+1
> Repeat1__numRows=Repeat1__numRows-1
> Recordset1.MoveNext()
> Wend
> %>
>
> </table>
>
> </body>
> </html>
> <%
> Recordset1.Close()
> Set Recordset1 = Nothing
> %>
>
>
> Cheers,
> Iain
>
| |
|
| No change unfortunately.
Iain
| |
|
|
| byardaj 2006-02-12, 6:30 pm |
| Code works fine in FireFox1.5, Safari and Camino. Can't find IE on my machine?
(Where'd it go?) Just been on M$ site to download new copy and found:
INTERNET EXPLORER FOR MAC NO LONGER AVAILABLE FOR DOWNLOAD
In June 2003, the Microsoft Macintosh Business Unit announced that Internet
Explorer for Mac would undergo no further development, and support would cease
in 2005. In accordance with published support lifecycle policies, Microsoft
ended support for Internet Explorer for Mac on December 31st, 2005, and is not
providing any further security or performance updates.
Accordingly, as of January 31st, 2006, Internet Explorer for the Mac is no
longer available for download from Microsoft. It is recommended that Macintosh
users migrate to more recent web browsing technologies such as Apple's Safari.
Anyone know where I can get the last IE for OSX
| |
|
| Hi Murray,
Yup - that code works fine, it just seems to not work when it's a repeat
region and pulling data from a database.
This is a work, intranet project, but if I get time, I might recreate it at
home and post a link. Its not a huge deal - I've at least got it all legible
for those using Macs, this is just detail really.
I never did figure out what else was happening - just something odd in that IE
mac seemed to be seeing some of the styling for the links in the drop down
menus.
Iain
| |
| Murray *TMM* 2006-02-12, 6:30 pm |
| > Yup - that code works fine, it just seems to not work when it's a repeat
> region and pulling data from a database.
See - by the time it gets to IE to be rendered, both pages would look
identical, since it's just HTML. IE would have no sense of the database
stuff that is all removed by the server BEFORE uploading the page to IE.
--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================
"dukla" <webforumsuser@macromedia.com> wrote in message
news:dsd0h7$7n0$1@forums.macromedia.com...
> Hi Murray,
>
> Yup - that code works fine, it just seems to not work when it's a repeat
> region and pulling data from a database.
>
> This is a work, intranet project, but if I get time, I might recreate it
> at
> home and post a link. Its not a huge deal - I've at least got it all
> legible
> for those using Macs, this is just detail really.
>
> I never did figure out what else was happening - just something odd in
> that IE
> mac seemed to be seeing some of the styling for the links in the drop down
> menus.
>
> Iain
>
| |
| Murray *TMM* 2006-02-12, 6:30 pm |
| Tom:
It wouldn't make any difference at all. It's just HTML by the time it gets
to the browser.
I do agree that your method is a more elegant way, but it's not relevant to
the reason that the styling isn't working properly in IE/Mac.
--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================
"Tom Muck" <tommuck@NOSPAM.basic-drumbeat.com> wrote in message
news:dsd1jc$94c$1@forums.macromedia.com...
> Try this. Much easier using the counter from the repeat region and the MOD
> function (all one line):
>
> <tr class="<%If (Repeat1__numRows Mod 2) Then Response.Write("row1") Else
> Response.Write("row2")%>">
>
> Tom Muck
> http://www.tom-muck.com/
>
> "dukla" <webforumsuser@macromedia.com> wrote in message
> news:dsd0h7$7n0$1@forums.macromedia.com...
> at
> legible
> that IE
>
>
| |
| Tom Muck 2006-02-12, 6:30 pm |
| Try this. Much easier using the counter from the repeat region and the MOD
function (all one line):
<tr class="<%If (Repeat1__numRows Mod 2) Then Response.Write("row1") Else
Response.Write("row2")%>">
Tom Muck
http://www.tom-muck.com/
"dukla" <webforumsuser@macromedia.com> wrote in message
news:dsd0h7$7n0$1@forums.macromedia.com...
> Hi Murray,
>
> Yup - that code works fine, it just seems to not work when it's a repeat
> region and pulling data from a database.
>
> This is a work, intranet project, but if I get time, I might recreate it
at
> home and post a link. Its not a huge deal - I've at least got it all
legible
> for those using Macs, this is just detail really.
>
> I never did figure out what else was happening - just something odd in
that IE
> mac seemed to be seeing some of the styling for the links in the drop down
> menus.
>
> Iain
>
| |
| Les Matthews 2006-02-12, 6:30 pm |
| "Murray *TMM*" <forums@HAHAgreat-web-sights.com> wrote in message
news:dsd1mq$9bv$1@forums.macromedia.com...
> Tom:
>
> It wouldn't make any difference at all. It's just HTML by the time it
> gets to the browser.
Maybe it's the content coming from the DB like unescaped apostrophes or
quotation marks?
| |
| Murray *TMM* 2006-02-12, 6:30 pm |
| Only the Shadow knows at this point. 8)
--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================
"Les Matthews" <LesAMatthews@yahoo.com> wrote in message
news:dsd2a5$a8k$1@forums.macromedia.com...
> "Murray *TMM*" <forums@HAHAgreat-web-sights.com> wrote in message
> news:dsd1mq$9bv$1@forums.macromedia.com...
>
> Maybe it's the content coming from the DB like unescaped apostrophes or
> quotation marks?
>
| |
| Chris In Madison 2006-02-12, 6:30 pm |
| It's possible that IE/Mac doesn't render the background color on the <tr>
tag. I think I've run into this in the past, but it's been a long time.
Try the same on the <td> tag and see if it makes a difference.
Best regards,
Chris
| |
| Murray *TMM* 2006-02-12, 6:30 pm |
| <sigh> 8)
It does. Look here - http://www.murraytestsite.com/rowtesting.html
--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================
"Chris In Madison" <cowens@GOAWAYDIRTYRATSPAMMERScnw.com> wrote in message
news:dsd36f$bgh$1@forums.macromedia.com...
> It's possible that IE/Mac doesn't render the background color on the <tr>
> tag. I think I've run into this in the past, but it's been a long time.
> Try the same on the <td> tag and see if it makes a difference.
>
> Best regards,
> Chris
>
>
| |
| Tom Muck 2006-02-12, 6:30 pm |
| "Murray *TMM*" <forums@HAHAgreat-web-sights.com> wrote in message
news:dsd1mq$9bv$1@forums.macromedia.com...
> Tom:
>
> It wouldn't make any difference at all. It's just HTML by the time it
gets
> to the browser.
>
> I do agree that your method is a more elegant way, but it's not relevant
to
> the reason that the styling isn't working properly in IE/Mac.
Sorry, I thought he said the HTML was fine but the dynamic part didn't work.
Tom
| |
| Murray *TMM* 2006-02-12, 6:30 pm |
| Yeah. Soon, we will be free of these monstrosities, though.... 8)
--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================
"Chris In Madison" <cowens@GOAWAYDIRTYRATSPAMMERScnw.com> wrote in message
news:dsd3rr$cft$1@forums.macromedia.com...
> Another fine browser anomaly to contend with :-p
>
> Luckily, IE/Mac has left the building. Unfortunately, lotsa people still
> using it...
>
> Best regards,
> Chris
>
>
| |
| Chris In Madison 2006-02-12, 6:30 pm |
| Another fine browser anomaly to contend with :-p
Luckily, IE/Mac has left the building. Unfortunately, lotsa people still
using it...
Best regards,
Chris
| |
| Murray *TMM* 2006-02-12, 6:30 pm |
| Heh - no, at least I don't *think* that's what he was saying! 8)
--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================
"Tom Muck" <tommuck@NOSPAM.basic-drumbeat.com> wrote in message
news:dsd50s$e6m$1@forums.macromedia.com...
> "Murray *TMM*" <forums@HAHAgreat-web-sights.com> wrote in message
> news:dsd1mq$9bv$1@forums.macromedia.com...
> gets
> to
>
> Sorry, I thought he said the HTML was fine but the dynamic part didn't
> work.
>
> Tom
>
>
| |
|
| Thanks guys.
Murray - the jist I got was that your sample code simple had a four row table,
and gave rows 1 and three the row1 style, and rows 2 and 4 the row2 style. Like
I said before, that did work fine.
But I was trying to alternate the row styles for a datavase driven repeat
region, using that count code - and for whatever reason it wasn't working -
whether it was some conflict elsewhere or the counting code itself I have no
idea.
But the good news is that your alternative code does work Tom - plus it seems
to have fixed the other issue I had, with some stray styling affecting the
links in the repeat region to details pages - so it does all now work as it
should.
Cheers,
Iain
| |
| Murray *TMM* 2006-02-12, 6:31 pm |
| So that means that your code was not properly styling the rows, then.
<sigh>
A glance at your page would have solved this hours ago.
Apologies to Tom, et. al....
--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================
"dukla" <webforumsuser@macromedia.com> wrote in message
news:dsd9ii$kkf$1@forums.macromedia.com...
> Thanks guys.
>
> Murray - the jist I got was that your sample code simple had a four row
> table,
> and gave rows 1 and three the row1 style, and rows 2 and 4 the row2 style.
> Like
> I said before, that did work fine.
>
> But I was trying to alternate the row styles for a datavase driven repeat
> region, using that count code - and for whatever reason it wasn't
> working -
> whether it was some conflict elsewhere or the counting code itself I have
> no
> idea.
>
> But the good news is that your alternative code does work Tom - plus it
> seems
> to have fixed the other issue I had, with some stray styling affecting the
> links in the repeat region to details pages - so it does all now work as
> it
> should.
>
> Cheers,
> Iain
>
| |
| Joe Makowiec 2006-02-12, 6:32 pm |
| On 08 Feb 2006 in macromedia.dreamweaver, Murray *TMM* wrote:
> Yeah. Soon, we will be free of these monstrosities, though.... 8)
Any bets on when the last copy if IE6 leaves the building?
--
Joe Makowiec
http://makowiec.net/
Email: http://makowiec.net/email.php
| |
| Tom Muck 2006-02-12, 6:32 pm |
|
"Murray *TMM*" <forums@HAHAgreat-web-sights.com> wrote in message
news:dsda46$ld0$1@forums.macromedia.com...
> So that means that your code was not properly styling the rows, then.
>
> <sigh>
>
> A glance at your page would have solved this hours ago.
>
> Apologies to Tom, et. al....
No problem. My guess is the line break or space in the class attribute was
causing a problem for IE Mac.
Tom
| |
| Murray *TMM* 2006-02-12, 6:33 pm |
| Yeah....
--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================
"Tom Muck" <tommuck@NOSPAM.basic-drumbeat.com> wrote in message
news:dsdejr$rmi$1@forums.macromedia.com...
>
> "Murray *TMM*" <forums@HAHAgreat-web-sights.com> wrote in message
> news:dsda46$ld0$1@forums.macromedia.com...
>
> No problem. My guess is the line break or space in the class attribute was
> causing a problem for IE Mac.
>
> Tom
>
>
| |
|
| Sorry - didn't mean to be so difficult. :-(
I know the rows weren't being styled propoerly - that why I posted here.
And I know your code works Murray, but it didn't when it had the counting code
to apply the style, rather than simply tagging each row individually like :
<tr class="row1">
<td> </th>
<td> </th>
<td> </th>
</tr>
<tr class="row2">
<td> </th>
<td> </td>
<td> </td>
</tr>
<tr class="row1">
<td> </th>
<td> </td>
<td> </td>
</tr>
<tr class="row2">
<td> </th>
<td> </td>
<td> </td>
</tr>
So regardless of what was causing the problem, all I knew was that it works
like that, but didn't with the counting.
Anyway, its working now, so cheers for the pointers.
Iain :)
| |
| Murray *TMM* 2006-02-12, 6:33 pm |
| Next time this comes up, browse to the page and view source. You could have
seen in an instant that the rows were not being styled properly.
--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================
"dukla" <webforumsuser@macromedia.com> wrote in message
news:dsdjsh$5fe$1@forums.macromedia.com...
> Sorry - didn't mean to be so difficult. :-(
>
> I know the rows weren't being styled propoerly - that why I posted here.
>
> And I know your code works Murray, but it didn't when it had the counting
> code
> to apply the style, rather than simply tagging each row individually like
> :
>
> <tr class="row1">
> <td> </th>
> <td> </th>
> <td> </th>
> </tr>
> <tr class="row2">
> <td> </th>
> <td> </td>
> <td> </td>
> </tr>
> <tr class="row1">
> <td> </th>
> <td> </td>
> <td> </td>
> </tr>
> <tr class="row2">
> <td> </th>
> <td> </td>
> <td> </td>
> </tr>
>
> So regardless of what was causing the problem, all I knew was that it
> works
> like that, but didn't with the counting.
>
> Anyway, its working now, so cheers for the pointers.
>
> Iain :)
>
| |
|
| I'm sure we're talking at cross purposes here - I realised the rows weren't styling properly - I just didn't know why.
Iain :)
|
|
|
| | Copyright 2003 - 2008 forum4designers.com Software forum Computer Hardware reviews |
|