无法查看表格标题中的链接

发布于 2024-12-23 09:46:10 字数 1290 浏览 1 评论 0 原文

我正在尝试将表的标题之一更改为链接,以便用户可以对该列进行排序(按照 这个railscast 问题是,我的专栏标题中没有显示任何内容。大概这是一些 CSS 问题/背景颜色的问题,但我仍然有点太绿了,无法弄清楚。

这是我的标题(sortable 是我的助手中返回 link_to 的方法):

  <table class="standard-grid mtm">
    <tr>
      <th class="first"> <input type="checkbox" id="selectAll" value="selectAll"> All<br/><br/> </th>
      <th>ID</th>
      <th>Customer</th>
      <th>Resume URL</th>
      <th>Partner</th>
      <th>Status</th>
      <th>Assigned To</th>
     <th>Comments</th>
      <th>Sent To</th>
      <th> <% sortable "date_email_delivered", "Sent On" %> </th>
    </tr>
...
</table

这是(大概)相关的 css(在 application.css 中):

.standard-grid
  width: 100%
  border-left: 1px solid #676D6F
  border-top: 1px solid #676D6F
  th, td
    border-right: 1px solid #676D6F
    border-bottom: 1px solid #676D6F
    padding: 10px
    min-width: 70px
  th
    background: #505155 image-url("nav-tabs/tab.gif") bottom left repeat-x
    color: #fff
    font-weight: bold

    a
      color: #aaa

I'm trying to change one of the headers of a table to a link so that the user can sort on that column (as per this railscast
the problem is, nothing is showing up in the header of my column. presumably this is some CSS issue/background color thing but i'm still a bit too green to figure it out.

here is my header (sortable is a method in my helper that returns a link_to):

  <table class="standard-grid mtm">
    <tr>
      <th class="first"> <input type="checkbox" id="selectAll" value="selectAll"> All<br/><br/> </th>
      <th>ID</th>
      <th>Customer</th>
      <th>Resume URL</th>
      <th>Partner</th>
      <th>Status</th>
      <th>Assigned To</th>
     <th>Comments</th>
      <th>Sent To</th>
      <th> <% sortable "date_email_delivered", "Sent On" %> </th>
    </tr>
...
</table

here is the (presumably) relevant css (in application.css):

.standard-grid
  width: 100%
  border-left: 1px solid #676D6F
  border-top: 1px solid #676D6F
  th, td
    border-right: 1px solid #676D6F
    border-bottom: 1px solid #676D6F
    padding: 10px
    min-width: 70px
  th
    background: #505155 image-url("nav-tabs/tab.gif") bottom left repeat-x
    color: #fff
    font-weight: bold

    a
      color: #aaa

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

自我难过 2024-12-30 09:46:10

因为我在 Rails 3 工作

<% sortable "date_email_delivered", "Sent On" %>

应该是:

<%= sortable "date_email_delivered", "Sent On" %> 

since i'm working in rails 3

<% sortable "date_email_delivered", "Sent On" %>

should be:

<%= sortable "date_email_delivered", "Sent On" %> 
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文