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

  • 相关阅读:
    三方登录微博url接口
    微博三方登录流程 (原理)
    celery配置与基本使用
    spring 验证框架
    IDEA 插件整理
    spring security笔记 默认登陆页面源码
    EXTJS7 自定义日期时间选择输入框
    EXTJS7 combobox本地模式 动态修改选项
    EXTJS7 combobox 下拉加载数据源码
    nginx 反向代理端口号丢失处理
  • 原文地址:https://www.cnblogs.com/shizhijie/p/7844430.html
Copyright © 2011-2022 走看看