c# - 显示表格的所有边框线

标签 c# asp.net asp.net-mvc html

为什么:

 <table style="border:1px solid black; " class="table-bordered table-striped table">
            <colgroup>
                <col id="Col1" />
                <col id="Col2" />
                <col id="Col3" />
                <col id="Col4" />
                <col id="Col5" />
            </colgroup>
            <thead>
                <tr>
                    <th style="border:1px solid black;" scope="col">@T("Code")</th>
                    <th style="border:1px solid black;" scope="col">@T("Product")</th>
                    <th style="border:1px solid black;" scope="col">@T("Unit Price")</th>
                    <th style="border:1px solid black;" scope="col">@T("Quantity")</th>
                    <th style="border:1px solid black;" scope="col">@T("Value")</th>
                </tr>
            </thead>
            <tbody>

看起来像: enter image description here

我想显示所有单元格的所有边框?
应在 <table> 中的样式做过这个吗?

最佳答案

当使用 css 时,你可以像这样设置表格的边框和它的单元格

table, th, td
{
    border: 1px solid black;
}

关于c# - 显示表格的所有边框线,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21019125/

相关文章:

asp.net - 如何使用 MVC 4 和 View 模型(强类型)呈现一组复选框

asp.net-mvc - 如何从 View 中检索传递给我的自定义 EditorFor 的对象属性的 VALUE?

jquery - 带 dropzone 的后正规形式

c# - 在 .Net 3.5 中实现随机提供程序

c# - 无法在 C++/CLI 中找到入口点

c# - 我可以通过 bool 条件将 IEnumerable 拆分为两个而不需要两个查询吗?

c# - 为 ASP.NET 实现 HierarchicalDataBoundControl

asp.net - 如何将调试器附加到 IIS 而不是 ASP.NET 开发服务器?

javascript - 使用 Web Api Controller 参数映射 AngularJs 查询字符串

c# - 如何创建返回禁止结果的过滤器