Printable Version of Topic

Click here to view this topic in its original format

HTMLHelp Forums _ Web Site Functionality _ code with class nd col

Posted by: jvandal Jul 30 2015, 09:37 PM

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]
<td class="col1">{{id}}</td>
<td>{{brand}} </td>
# <td class="col3">{{color}}</td>
<td><a href="/edit/{{id}}">Edit</a></td>
<td><a href="/delete/{{id}}">Delete</a></td>

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?

Posted by: CharlesEF Jul 31 2015, 06:17 AM

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.

Powered by Invision Power Board (
© Invision Power Services (