I have a table with forms in two colors - the first row is one color, the second is the other. Can you please tell me if there is a way to optimize my code (such as with this)?
I have two CSS classes:
tr.content1{
background-color: #EFF4FA;
}
tr.content2{
background-color: #F7FAFD;
}
And the table looks this way:
<tr class="content1">
<td>Previous Plan:</td>
<td>{{ form_row(form.prev_plan) }}</td>
</tr>
<tr class="content2">
<td>Previous Server:</td>
<td>{{ form_row(form.prev_srv) }}</td>
</tr>
There is also a problem this way - I get some text in the second column in front of the form field.
DL
s maybe. But tables are still the ideal and most proper way of presenting tabular data. – Lèse majesté Aug 6 '12 at 16:16div
s andspan
s and using CSS to imitate the proper semantic elements. That'd be like replacing all of your links withspans
that haveonclick
handlers or usingspan
s in place ofh1
,h2
,h3
....div
s andspan
s do not have asummary
attribute,colgroup
s, proper table headers, nor do they haveaxis
,scope
, orheaders
attributes to associate the data cells with their respective headers. – Lèse majesté Aug 6 '12 at 17:12