Single quotes are white-space preserving, so why are you using multiple string additions?
Code:
$output='
<tr class="'.$funky_zebra.'" title="See details for this Event">
<td class="ev-date">'.$event_start.$event_end.'</td>
<td class="ev-name"><a href="'.$event_permalink.'">'.$event_title.'</a></td>
<td class="ev-location">'.$event_location.'</td>
<td class="ev-status ev-status-'.$event_status_color.'">'.$event_status.'</td>
</tr>';
NOT that as a rule I like building strings of markup, since string addition is slower than delimited output. A comma delimited echo is faster to execute and more reliable/predictable.
Code:
echo '
<tr class="',$funky_zebra,'" title="See details for this Event">
<td class="ev-date">',$event_start,$event_end,'</td>
<td class="ev-name"><a href="',$event_permalink,'">',$event_title,'</a></td>
<td class="ev-location">',$event_location,'</td>
<td class="ev-status ev-status-',$event_status_color,'">',$event_status,'</td>
</tr>';
Kind of laughing at the responses so far, many of which advocate throwing MORE code at something so simple... from templating library bloat to the idiotic "let's open and close php on every line" nonsense...
I'm just wondering why you thought you needed to use double quotes and /t /n just to add carriage returns and tabs...
Off Topic:
...and why you'd put TITLE on a TR, or if those classes are even necessary since you could leverage colgroups for everything but FF and nth-child/sibling selectors for geckotards...
Bookmarks