|
Posted by Ψrjan Langbakk on 06/24/06 13:20
Den 24.06.2006 14:40, skriblet Geoff Berrow fΓΈlgende:
> Message-ID: <449d2e3f$1@news.broadpark.no> from Γrjan Langbakk contained
> the following:
>
>> I need to have each <td> present in the code, so as to be able
>> to assign a class to the last one, but how? I can tell as much as that I
>> know the number of <td>'s in each CSV-file - they are a constant).
>>
>> Any help would be appreciated.
>
> Untested.
> ...
> $this->html .= "<tr>";
> $count=0;
> foreach($row as $field){
> if($count<3){
> $this->html .= "<td>$field</td>";
> }
> else{
> $this->html .= "<td
> style='text-align:center'>$field</td>";
> }
> $count ++;
> }
> $this->html .= "</tr>\n";
>
> ...
Works like a charm :)
Now, is there a way I can use _this_ code to also add styles to other
<td>s? Or is this a "one-stop" option? I tried adding more counts, but
couldn't seem to get it right - probably because I missed a basic point
somewhere :)
--
mvh
Γrjan Langbakk
Navigation:
[Reply to this message]
|