修改日志列宽度,详情宽度
This commit is contained in:
@@ -10,7 +10,7 @@ $(document).ready(function() {
|
||||
this.title=str;
|
||||
});
|
||||
var fontSize = 0;
|
||||
$("table.logTb th").each(function(){
|
||||
$("table.logTb th").each(function(j){
|
||||
// 判断是否支持currentStyle属性 是:IE 否:FF or Chrome
|
||||
var finalStyle = this.currentStyle ? this.currentStyle : document.defaultView.getComputedStyle(this , null);
|
||||
fontSize = (finalStyle.fontSize).replace("px","");
|
||||
@@ -20,11 +20,15 @@ $(document).ready(function() {
|
||||
// URL列加宽
|
||||
var th = this;
|
||||
var thText = this.innerText;
|
||||
$("table.logTb td").each(function(){
|
||||
var tdText = this.innerText;
|
||||
if((tdText.trim().length > thText.trim().length) && (thText == "URL" || thText == "Log URI")){
|
||||
th.setAttribute('width','110px');
|
||||
}
|
||||
//将字符串过宽的列增加宽度
|
||||
$("table.logTb tbody tr").each(function(){
|
||||
$(this).find("td").each(function(i){
|
||||
var tdText = this.innerText;
|
||||
if((tdText.trim().length > thText.trim().length) && j==i && tdText.trim().length>7){
|
||||
var px = getPixelsCount(thText,fontSize)+100;
|
||||
th.setAttribute('width',px+'px');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user