I'm trying to output an HTML table using razor. The table itself works, but now I'm trying to add a class called "even" to every other row in the table:

```
<table>
    <thead>
        <tr>
            <th>Column 1</th>
            <th>Column 2</th>
            <th>Column 3</th>
        </tr>
    </thead>
    <tbody>
        @for (int i = 0; i < ViewBag.MyList.Count; i++)
        {
            var myObject = ViewBag.MyList[i];
            <tr @if (i % 2 == 0 ) { class="even" }>
                <td>myObject.Column1</td>
                <td>myObject.Column2</td>
                <td>myObject.Column3</td>
            </tr>
        }
    </tbody>
</table>

```

There's obviously something wrong with that if-case inside the loop, but what is the correct way of writing this?