Jump to content

Creating HTML table from single template


JerryDi
 Share

Recommended Posts

Hi @JerryDi,

Try the follow code:

<table border=1> 
<thead>   
<tr> 
	<th>Opponents</th> 
        <th>Venue</th> 
	<th>Points for</th> 
	<th>Points against</th> 
        <th>Result</th> 
 
</tr>
</thead>

<tbody>


<?php $countymatch = $pages->find("template=county-match-result, year={$page->title} "); foreach($countymatch as $match):  ?>
 
<tr>
<td><?php echo "<a href='$match->url'> {$match->title}</a>"; ?></td> 

<td>
<?php if ($match->home_away->title == 'Home'){
 //echo $match->home_match_venue->title("<a href='{url}'>{title}</a>");
// I don't really understand this line, so I comment it and see if you get more results
} else{
echo $match->away_match_venue;
}; ?>
</td>
 
            <td><?php echo $match->cheshire_points; ?></td> 
	    <td><?php echo $match->opponent_points; ?></td> 
            <td><?php echo $match->match_result->title; ?></td> 
 </tr>
  <?php endforeach; ?>
  </tbody>
</table> 

Gideon

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...