Administration/Custom Channel Fields/ Edit Field
Создаю
Табличку
cell1, cell2, cell3, cell4
В шаблоне вывожу ее таким макаром
<p class="options-title">Доступные модели:</p>
<table id="mytable" cellspacing="0" summary="Доступные модели">
<thead>
<tr>
<th scope="col1" abbr="Model" class="nobg">Модель</th>
<th scope="col1" abbr="tabletop">Столешница</th>
<th scope="col1" abbr="additionally">Дополнительно</th>
<th scope="col1" abbr="Dimensions">Размеры (L x D x H)</th>
</tr>
</thead>
{table}
<tr>
<th scope="row" abbr="Model">{cell_1}</th>
<td>{cell_2}</td>
<td>{cell_3}</td>
<td>{cell_4}</td>
</tr>
{/table}
</table>
Добавляю стиль к ней чтобы все красяво было
#mytable {
width: 500px;
padding: 0;
margin: 0;
border-collapse: collapse;
}
caption {
padding: 0 0 5px 0;
width: 500px;
font: italic 11px “Trebuchet MS”, Verdana, Arial, Helvetica, sans-serif;
text-align: right;
font-style: italic;
}
th {
font: bold 11px “Trebuchet MS”, Verdana, Arial, Helvetica, sans-serif;
color: #4f6b72;
border-right: 1px solid #C1DAD7;
border-bottom: 1px solid #C1DAD7;
border-top: 1px solid #C1DAD7;
letter-spacing: 2px;
text-transform: none;
text-align: left;
padding: 6px 6px 6px 12px;
background: #CAE8EA url({theme}/images/bg_header.jpg) no-repeat;
}
thead th:first-child {
border-top: 0;
border-left: 0;
border-right: 1px solid #C1DAD7;
background: none;
}
tbody td {
border-right: 1px solid #C1DAD7;
border-bottom: 1px solid #C1DAD7;
background: #fff;
padding: 6px 6px 6px 12px;
color: #4f6b72;
}
tbody tr:nth-child(odd) td {
background: #F5FAFA;
color: #797268;
}
tbody th{
font: bold 10px “Trebuchet MS”, Verdana, Arial, Helvetica, sans-serif;
border-left: 1px solid #C1DAD7;
border-top: 0;
font: bold;
background: #fff url({theme}/images/bullet1.gif) no-repeat;
}
tbody tr:nth-child(odd) th {
background: #f5fafa url({theme}/images/bullet2.gif) no-repeat;
color: #797268;
}
Все хорошо выходит ( см картинку )
Но бывает так что нету к определенному товару, доступных моделей, таблица не заполняется и получается фигня. (см картинку)
Вот тут возникает вопрос,
1) в документации к матрикс есть о том что можно назначить стили к табличке
2) собственно через
{if значение} {значение} {/if}
будет показываться или нет наша таблица
Но что то не выходит у меня.