简体   繁体   English

安排第一半左边和 rest 右边

[英]arrange 1st half left and the rest right

how to arrange the first half left and the second half right?前半段左后半段如何排列? (instead of the first goes left, second goes right, 3rd goes let, 4th goes right and so on) (而不是第一个向左,第二个向右,第三个让,第四个向右等等)

Javascript: Javascript:

  do {
    document.querySelector("main").innerHTML += 
      "<div class='timeTable'>" + 
      tempTime.format("DD-MM-YY | HH:mm") + 
      " - " + tempTime.add(30, "minutes").format("HH:mm") + 
      "</div>";
  } while (tempTime.format("HH:mm") != "19:00");

CSS: CSS:

* {
  box-sizing: border-box;
}
.timeTable {
  width: 50%;
  float: left;
  text-align: center;
}

PS: btw tempTime is a momentjs object (which is irrelevant to the question and just in case somebody is wondering) PS:顺便说一句 tempTime 是一个 momentjs object (这与问题无关,以防万一有人想知道)

found it:找到了:

main {
        display: grid;
        grid-template-columns: auto auto;
        grid-template-rows: repeat(9,auto);
        grid-auto-flow: column;
    }

repeat(9,auto) because of 18 boxes... divided by 2 is 9由于 18 个框而重复(9,auto)...除以 2 是 9

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

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