Issue with CSS width and views columns and headers

夙愿已清 提交于 2019-12-13 00:40:49

问题


I have some CSS I am applying to a view header and view column.

Here is a sample

.viewHeaderName {
width:235px;
background-color:rgb(192,192,192);
color:rgb(0,0,0);
font-family:Trebuchet MS,sans-serif;
font-size:10t;
font-weight:bold;
text-align:left;
}

.viewColumnName {

font-family:Trebuchet MS,sans-serif;
font-size:9pt;      

}

Basically I am trying to set the width of the column to what I want. I don't want the text in the header or in the column to wrap. This works perfectly for categorized views for all the columns.

But for simple sorted views, the header is being offset to the right from the text in the column several characters.

If I remove the width parameter in the CSS then everything lines up fine but I don't get the width I want.


回答1:


you can use td/th nowrap attribute described here

http://www.w3schools.com/tags/att_td_nowrap.asp

or

use white-space element in css described here

http://www.w3schools.com/cssref/pr_text_white-space.asp

white-space:nowrap;



来源:https://stackoverflow.com/questions/12502838/issue-with-css-width-and-views-columns-and-headers

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!