Help - Search - Members - Calendar
Full Version: code with class nd col
HTMLHelp Forums > Web Authoring > Web Site Functionality
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?
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.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2022 Invision Power Services, Inc.