dtmbc1606 2019-05-16 12:13
浏览 66

在每列中创建一个带有选项卡面板的网格?

I'm attempting to create a table/grid using divs to show multiple tabs panels, side to side, this is for a car rental website.

I tried to use a row by row layout for the tab panels with a picture but the picture took up the entire row. I'm Displaying the Tab Panel as part static and part tab panel with Header first, Picture Second, and Tab Panels with prices and info third.

My problem is that the moment I put my tabs inside a table/ div table or any div that denotes the use of rows and columns, the tab panel will no longer show as tab panel. The Example Below is an altered example I used from http://jsfiddle.net/DHTTWL/jmdjpge0/ where I'm attempting to create a grid. What would be the best way to display tabs in table format?

<style>
.grid-container {
display : grid;
grid-template-columns: auto auto;
background-color: #2196F3;
padding: 10px;
}
</style>


<div class="grid-container">
<div class="grid-item">

<div id="tabs">
<ul>
<li><a href="#tabs-1">First Tab</a></li>
<li><a href="#tabs-2">Second Tab</a></li>
</ul>
<div id="tabs-1">
<p>Tabs in tab!</p>
  <div id="more-tabs1">
      <ul>
          <li><a href="#nested-tabs-1">Child Tab 1</a></li>
          <li><a href="#nested-tabs-2">Child Tab 2</a></li>
      </ul>
      <div id="nested-tabs-1"><p>Content here...</p></div>
      <div id="nested-tabs-2"><p>More content here...</p></div>
  </div>
  </div>
  <div id="tabs-2">
   <p>Tabs in tab!</p>
   <div id="more-tabs">
      <ul>
          <li><a href="#nested-tabs-1">Child Tab 1</a></li>
          <li><a href="#nested-tabs-2">Child Tab 2</a></li>
      </ul>
      <div id="nested-tabs-1"><p>Content here...</p></div>
      <div id="nested-tabs-2"><p>More content here...</p></div>
  </div>
 </div>
 </div>
 </div>
 <div class="grid-item">


 <div id="tabs">
 <ul>
 <li><a href="#tabs-1">First Tab</a></li>
 <li><a href="#tabs-2">Second Tab</a></li>
 </ul>
 <div id="tabs-1">
 <p>Tabs in tab!</p>
  <div id="more-tabs1">
      <ul>
          <li><a href="#nested-tabs-4">Child Tab 1</a></li>
          <li><a href="#nested-tabs-5">Child Tab 2</a></li>
      </ul>
      <div id="nested-tabs-4"><p>Content here...</p></div>
      <div id="nested-tabs-5"><p>More content here...</p></div>
  </div>
</div>
<div id="tabs-2">
  <p>Tabs in tab!</p>
  <div id="more-tabs">
      <ul>
          <li><a href="#nested-tabs-6">Child Tab 1</a></li>
          <li><a href="#nested-tabs-7">Child Tab 2</a></li>
      </ul>
      <div id="nested-tabs-6"><p>Content here...</p></div>
      <div id="nested-tabs-7"><p>More content here...</p></div>
  </div>
 </div>
</div>
</div>
</div>
<script>
$(function() {
$( "#tabs" ).tabs();
$( "#more-tabs" ).tabs();
$( "#more-tabs1" ).tabs();
});
</script>

This code renders the first tab but not the second, the second tabs end up showing in html format, should I use a second script for a second tab? I have a different script that is dynamic in the sense that you can add or remove tabs as you need to with all info however I\m experiencing the same problem of the tabs not all showing as they are designed.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
    • ¥20 有关区间dp的问题求解
    • ¥15 多电路系统共用电源的串扰问题
    • ¥15 slam rangenet++配置
    • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
    • ¥15 ubuntu子系统密码忘记
    • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
    • ¥15 保护模式-系统加载-段寄存器
    • ¥15 电脑桌面设定一个区域禁止鼠标操作
    • ¥15 求NPF226060磁芯的详细资料