今天再次碰到一个问题,就是调节table里面列的宽度,一开始我想调节字体的大小,把字体调大一点,但是我发现了一个问题,就是字体调大了,table里面的有一种字体的宽度限制了,直接我想显示的汉字,上下截取一部分了,字体调的越大,截取的就越多,最后导致页面很难看,百度了很长时间,都没有找到解决办法。
调节table的tr,td长宽高都能调节,就是字体被限制了,我一开始以为是因为字体的内边距导致的,后来发现才不是的,调节内边距左右都能调,就是上下没反应,我以为代码写错了,调了半天,才反应过来,应该不是内边距的问题。
后来突然想到了,还有另外一个属性是调table,那就是line-height,进过实践,果然是这个。
废话不多说,上代码:
<style type="text/css">
.datagrid-header span { line-height:80px ; font-size: 50px !important; }//调节行高,字体大小
.datagrid-header-row { Height: 50px; }
.panel-title {
margin-top: 20px;
margin-bottom: 20px;
font-size: 60px;
color: inherit;
}
.datagrid-btable tr{height: 80px;font-size :60px ;}
.datagrid-cell {font-size :30px ;line-height:60px ; }
</style>
</head>
<body>
<form id="form1" runat="server">
</form>
<div class="btnbarcontetn" style="margin-top: 1px; background: #fff; font-weight: bold"; >
<table id="tbGrid" class="datagrid" xmlname="YRunTaskList" title="1号堆垛机正在执行的任务" url="StackerList1.aspx?action=GridBindList" >
</table>
</div>
</body>