在html中制作自定义表格

时间:2017-10-19 07:03:10

标签: html css html-table

是否可以在HTML&像这样的CSS?

https://imgur.com/3NmbYnE

我希望有一个全高度列(右侧),其余部分是图像上的行。

2 个答案:

答案 0 :(得分:1)

您可以使用网格轻松实现此目的:



 [HttpPost]
 public string PostProducts([FromBody]List<SyncingControl> persons)
 {
    return persons.Count.ToString(); // 0, expected 3
 }
&#13;
.thead {
    padding: 5px;
    grid-area: thead;
    border: 3px solid gray;
}

.col {
    grid-area: col;
    border: 3px solid red;
}

.r {
    border: 3px solid green;
    padding: 5px;
}
.row-1 {
    grid-area: row-1;
}
.row-2 {
    grid-area: row-2;
}
.row-3 {
    grid-area: row-3;
}
.row-4 {
    grid-area: row-4;
}
.row-5 {
    grid-area: row-5;
}

.container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-areas:
    "thead thead"
    "row-1 col"
    "row-2 col"
    "row-3 col"
    "row-4 col"
    "row-5 col";
}
&#13;
&#13;
&#13;

Grid-template-areas真的值得研究。

答案 1 :(得分:0)

是的,可以使用rowspan and colspan attributes