BioloMICS logo
×
BioloMICS Web Menu

K field in razor (Color)

 
 
In this example of the Color field (K field) the background is the same color as the value of the field.
 
The value itself is shown as the Hex color code.
 
        <tr>
            <td>@Model.K301.Label</td>
            <td>
                <div style='background:@Model.K301'>
                    <span>@Model.K301</span>
                </div>
            </td>
        </tr>
 
 
The code placed in a table:
 
<table class="table">
    <thead>
    </thead>
    <tbody>
        <tr>
            <td>@Model.K301.Label</td>
            <td>
                <div style='background:@Model.K301'>
                    <span>@Model.K301</span>
                </div>
            </td>
        </tr>
    </tbody>
</table>