带网格的MVC3 Bootstrap tablular数据

5 asp.net-mvc grid razor twitter-bootstrap

我喜欢Bootstrap,我喜欢MVC 3和MVC 4,但是即使我看到很多Bootstrap示例,我也没有真正看到使用Bootstrap和MVC3以及类似网格系统中的表格数据的示例.

任何地方的例子?

  1. 我不想使用Telerik,KendoUI或其他许多东西
  2. 真的不会对"WebGrid"感到兴奋,因为我宁愿远离桌子

所以对使用Razor View Engine的Bootstrap有任何坚实的想法,以及如何避免使用表格?

LCa*_*ter 1

你必须以不同的方式思考这个问题。所有 twitter bootstrap 给你的只是一堆样式。

\n\n
1.  <table class="table table-bordered">\n2.    \xe2\x80\xa6\n3.  </table>\n
Run Code Online (Sandbox Code Playgroud)\n\n

如果您使用 ASP.NET MVC Razor、Angular.JS、Knockout.js、Handbar.js 或任何允许您获取数据并以编程方式创建动态 html 的东西,您将必须根据该语言的语法进行设置。

\n\n
@Model List<string>\n\n<table class="table table-bordered">\n      @foreach(var item in @Model){\n        <tr>\n          <td>@item</td>\n       </tr>\n      }\n</table>\n
Run Code Online (Sandbox Code Playgroud)\n\n

Bootstrap 只为您提供可重用样式的通用库。某些 HTML 必须以某种方式进行布局才能使样式正确运行,但这是设计使然,应参阅文档 @ http://twitter.github.io/bootstrap/index.html以获得更多帮助。

\n