3

我试图让下拉列表出现在表格行的特定列中,但它似乎不起作用。

我使用 chrome,但我似乎无法让它工作,我尝试过很多例子,但似乎没有一个工作。

<!DOCTYPE HTML>
<%@ page isELIgnored="false"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<html>
   <head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <script type="text/javascript" src="<%=request.getContextPath()%>/resources/js/bootstrap/bootstrap.js"></script>
      <link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/resources/css/bootstrap/bootstrap.css">
   </head>
   <body style="overflow: hidden;">
      <div class="container" align="center">
         <h1 style="margin-top: 100px;">Admin Page</h1>
         <table class="table table-bordered">
            <thead>
               <tr>
                  <th>Id</th>
                  <th>Game</th>
                  <th>Bonus</th>
               </tr>
            </thead>
            <tbody>
               <tr>
                  <td>1</td>
                  <td>Treasure Island</td>
                  <td>
                     <div class="dropdown">
                        <a data-target="#" data-toggle="dropdown" class="dropdown-toggle" href="#">Dropdown menu here...
                        <b class="caret"></b>
                        </a>
                        <ul class="dropdown-menu">
                           <li><a href="/app/1">Item A</a></li>
                           <li><a href="/app/2">Item B</a></li>
                           <li><a href="/app/3">Item C</a></li>
                        </ul>
                     </div>
                  </td>
               </tr>
            </tbody>
         </table>
      </div>
   </body>
</html>     
4

1 回答 1

4

假设您希望该下拉菜单由按钮触发,您可以执行以下操作...

<div class="btn-group">
    <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
        Action
        <span class="caret"></span>
    </a>
    <ul class="dropdown-menu">
        <!-- dropdown menu links -->
    </ul>
</div>
于 2013-11-23T19:06:47.910 回答