使用引导更改表头颜色 [英] Change table header color using bootstrap

查看:86
本文介绍了使用引导更改表头颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用bootstrap的MVC5应用程序。表列名是黑色
在白色背景上,我想把它改为蓝色背景和列
名称将是白色的,我怎么能这样做?
我试图使用CSS类没有成功...

I have a MVC5 application which uses bootstrap. The table column name is in black on white background and I want to change it to a blue background and the column name will be in white, how could I do that? I tried to play with the CSS classes without success...

<input type="button" value="Add" onclick="addRow()" class="data-button" id="add-row" />


    <table class="table" >
        <tr>
            <th>
                @Html.DisplayNameFor(model => model.name)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.checkBox1)
            </th>
            <th></th>
        </tr>


推荐答案

在您的CSS

th {
    background-color: blue;
    color: white;
} 

这篇关于使用引导更改表头颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆