The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

> code with class nd col, what does this code do
jvandal
post Jul 30 2015, 09:37 PM
Post #1





Group: Members
Posts: 2
Joined: 30-April 07
Member No.: 2,677



table border="0">
<tr><th>ID</th><th>CAr </th><th>Year</th></tr>
%for row in rows:
%id = row[0]
%brand = row[1]
%yearoner = row[2]
%color = row[3]
<tr>
<td class="col1">{{id}}</td>
<td>{{brand}} </td>
<td>{{yearoner}}</td>
# <td class="col3">{{color}}</td>
<td><a href="/edit/{{id}}">Edit</a></td>
<td><a href="/delete/{{id}}">Delete</a></td>
</tr>
%end
</table>

why don't the row[] have the same rowumber?
class = 'col1'
what doess class mean? and then col 'col1' reference col 1 ?
I would have thought col1 equal col1. then col2 should be mentioned before col3. why "class?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
 
Reply to this topicStart new topic
Replies(1 - 1)
CharlesEF
post Jul 31 2015, 06:17 AM
Post #2


Programming Fanatic
********

Group: Members
Posts: 1,981
Joined: 27-April 13
From: Edinburg, Texas
Member No.: 19,088



I have no idea what language this is in but I can tell you what it does. rows is an array of arrays and it basically does a for each loop for each array found in rows. It builds a table with a Edit and Delete option for each row of data. row[0]. row[1], row[2] and row[3] are elements in each array. There will always be 4 elements in each row array, that is why the numbers never change. class is used for CSS assignments. col1 will have some display statements, could be big text and red color, or anything else. col3 will have other display statements, maybe smaller text and blue color. col2 could have different statements that are not needed/used at this time. Basically that is what this code does.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 19th March 2024 - 01:58 AM