javascript - 如何居中对齐 onDemandGrid 标题

标签 javascript html css dgrid center-align

我正在使用 dgrid 的 onDemandGrid 并希望居中对齐特定的列标题,但不是网格中的所有标题。我将如何着手完成这项工作?

我的 css 文件中有以下内容:

.mywidget h3 {
  font-size: 1.2em;
}
.mywidget h3, p {
  margin-top: 0;
}

.dgrid {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    height: auto;
    font-size:larger;
}
.dgrid-row-odd {
  background: #F2F5F9;
}
.dgrid-column-A{
  width: 80px;
}
.dgrid-column-B{
  width: 120px;
}
.dgrid-column-C {
  width: 80px;
}
.dgrid-column-D {
  width: 120px;
}
.dgrid-column-E {
  width: 50px;
}
.dgrid-column-F {
  width: 70px;
}

最佳答案

这对我有用

.dgrid-header .dgrid-column-B {
  width: 120px;
  text-align:center;
}

关于javascript - 如何居中对齐 onDemandGrid 标题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43193027/

相关文章:

javascript - Bootstrap 仪表板

css - 列表元素第一行未正确对齐

javascript - $compile 不会将作用域变量插入 HTML

javascript - JShint 配置异常?

html - 使用无填充/边距/使空的跨度标签显示为全宽

javascript - 用 jquery 加载填充 div 中的值

html - CSS: anchor 不接受高度

html - 如何删除内联/内联 block 元素之间的空间?

javascript - 闭包编译器忽略对象突变

javascript - 哪些 ECMAScript 标准符合 Adob​​e 的 ExtendScript 实现? (如有)