简体   繁体   English

具有行详细信息的自适应网格

[英]Responsive grid with Row Details

I am looking for a responsive Grid System. 我正在寻找一个响应式网格系统。 The clue is, I also need something like Row Details for the clicked/selected cell (Cell Details? Expandable?). 提示是,对于单击/选定的单元格,我还需要类似“ Row Details ”之类的内容(“单元格详细信息”?是否可扩展?)。

For example: pr0gramm.com Its pretty close to my Feature. 例如: pr0gramm.com它非常接近我的功能。

Columns: 列:

  • Dekstop: 4 Dekstop:4
  • Tablet: 3 平板电脑:3
  • Phone: 2 电话:2

With all 4 Columns in a Row, I can just append a new div after the Row of the selected Cell. 在一行中有所有4列的情况下,我可以在所选单元格的行之后追加一个新的div。 See: http://i.stack.imgur.com/FcbfO.png 参见: http : //i.stack.imgur.com/FcbfO.png

With 3 of 4 Columns in a Row (still 4 Columns in the div) im getting this result: http://i.stack.imgur.com/5raJE.png 通过连续4列中的3列(div中仍为4列),我得到了以下结果: http : //i.stack.imgur.com/5raJE.png

Are there any frameworks or something similar? 有没有类似的框架? Or do I have to implement this by myself with js ? 还是我必须自己用js呢?

you can do that with CSS. 您可以使用CSS做到这一点。 add something like @media (max-width: 768px) to detect the screen size to give different CSSs to different screen sizes. 添加类似@media(最大宽度: 768像素)之类的内容以检测屏幕尺寸,以便为不同的屏幕尺寸提供不同的CSS。

No More Table is a good example 没有更多的表是一个很好的例子

HTML 的HTML

<div class="columns">
  <div>1</div>
  <div>2</div>
  <div>3</div>
  <div>4</div>
</div>

CSS 的CSS

@media (max-width: 1024px){

  .columns:nth-child(3){
    display:none;
  }

}

@media (max-width: 768px){

  .columns:nth-child(3){
    display:none;
  }

  .columns:nth-child(4){
    display:none;
  }

}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM