zoukankan      html  css  js  c++  java
  • jqgrid自动换行

    JQGrid表头自动换行的办法:

    如果table的header部分字段太多或字段文字太长需要自动换行时,可尝试如下css。

    <style type="text/css" media="screen">
        th.ui-th-column div{
            white-space:normal !important;
            height:auto !important;
            padding:0px;
        }

    然后在文字中需要换行的地方加空格,这样就能实现自动换行了。

    单元格内的文本自动换行 :

    加入样式:

    .<style>
    .ui-jqgrid tr.jqgrow td {
       white-space: normal !important;
       height:auto;
       vertical-align:text-top;
       padding-top:2px;
     }
    </style>

    注意:这种设置无法让长英文字母或数字自动换行,例如:wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww.txt

    (IE浏览器)连续的英文字符和阿拉伯数字,需使用word-wrap : break-word ;或者word-break:break-all;实现强制断行,即:

    <style>
    .ui-jqgrid tr.jqgrow td {
      white-space: normal !important;
      height:auto;
      vertical-align:text-top;
      padding-top:2px;
      word-break:break-all;
     }
    </style>

    (Firefox浏览器)连续的英文字符和阿拉伯数字的断行,Firefox的所有版本还没有解决这个问题,我们只有让超出边界的字符隐藏或者,给容器添加滚动条

    转自http://blog.csdn.net/zhengxiangwen/article/details/9120215

  • 相关阅读:
    并发编程-process对象的其他属性方法
    Python json格式处理
    msf制作反弹shell
    Windows渗透备忘录
    WPF listbox实现多列显示数据
    Postgresql插入或更新操作upsert
    Windows 10 IoT Core Samples
    物联网平台开源
    实现领域驱动设计
    wpf Visibility 动画
  • 原文地址:https://www.cnblogs.com/shizhijie/p/7844430.html
Copyright © 2011-2022 走看看