前台表格边框样式

这三种同时存在  table内外边框都有 边框线粗细:1px 颜色:#6faadb;  .divTable:表格最外层div的ID
.divTable table td{ border:solid #6faadb; border
-0px 1px 1px 0px; } .divTable table th{ border:solid #6faadb; border-0px 1px 1px 0px; } .divTable table{ border:solid #6faadb; border-1px 0px 0px 1px; }

设置表格字段过长,省略显示不下的,鼠标上浮显示全部信息

<td style="word-break:keep-all;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;">
  <a href="javascript:vodi()" style="14%;overflow:hidden;text-decoration:none;color:#555555;cursor:default;" title="${sysClockInRecordsInfo.goToWorkAdds}">
    ${sysClockInRecordsInfo.goToWorkAdds}
  </a>
</td>


<td style="white-space:nowrap;overflow:hidden;text-overflow:ellipsis;">
  <a href="javascript:vodi()" style="text-decoration:none;color:#555555;cursor:default;" title="${sysClockInRecordsInfo.goToWorkAdds}">
    ${sysClockInRecordsInfo.goToWorkAdds}
  </a>
</td>
<td style="word-break:keep-all;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;" title="${sysDocFiles.fileName}">
  ${sysDocFiles.fileName} 
</td>

格式化table表格中字段保留小数点后2位小数

  <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

  <td><fmt:formatNumber type="number" value="${curObj.priceTotal}" pattern="0.00" maxFractionDigits="2"/></td>

 table设置边框属性

  border-collapse 

collapse 如果可能,边框会合并为一个单一的边框。会忽略 border-spacing 和 empty-cells 属性
separate 默认值。边框会被分开。不会忽略 border-spacing 和 empty-cells 属性
inherit 规定应该从父元素继承 border-collapse 属性的值

  table-layout

automatic 默认。列宽度由单元格内容设定。
fixed 列宽由表格宽度和列宽度设定。
inherit 规定应该从父元素继承 table-layout 属性的值。

设置表格最大高度,保证不会出现页面纵向滚动条

  var heightMax=parent.document.body.clientHeight;// 页面总高度
   var searchFormHeight=$("#searchForm")[0].clientHeight;//搜索栏高度
   var pageDivHeight=$("#pageDiv").height();//翻页插件高度
   //38:父页面页签高度(资产库) 
   //32:margin-top偏移量 偏移4次 父页面页签与搜索栏偏移8px 搜索栏与表格偏移8px 分页插件上下个偏移8px
   var differ=heightMax-searchFormHeight-pageDivHeight-38-32+"px";
   $("#tabDiv").css("max-height",differ);
最大高度=获取页面总高度-页面各个插件高度-页面元素高度偏移量
将其设置为表格最大高度 max-height
原文地址:https://www.cnblogs.com/ljc1212/p/10156228.html