如何更改GridView的行高 [英] How do I change row height of GridView

查看:350
本文介绍了如何更改GridView的行高的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,如何更改gridview的行高以使其保持静态?



我有10列,其中2列包含140字或更多的数据。如何使列例如高度为80px,但仍然可以在2列中看到我的所有文本?



我试过了

Hello, How do I change the row height of my gridview so that it will be static?

I have for example 10 columns, and 2 of such columns contains data 140 words or more. How do I make the columns for example to 80px in height but still be able to see all my text in the 2 columns?

I have tried

<asp:GridView ID="GridView1" rowstyle-height ="50px"





但它不起作用。



希望我能尽快解决这个问题!谢谢! :)



but it doesnt work.

Hope I will be able to solve this soon! Thanks! :)

推荐答案

不好主意。单元格的大小应由内容定义。您最好不要使用绝对大小并定义填充。在所有情况下,您都可以简单地定义 td 和/或 tr 元素的相应CSS属性。怎么样?从这里开始:

http://www.w3.org/TR/CSS2/box .html [ ^ ]。



-SA
Bad idea. The size of the cell should be defined by the content. You should better not use absolute sizes and define padding instead. In all cases, you simple define appropriate CSS properties of td and/or tr elements. How? Start here:
http://www.w3.org/TR/CSS2/box.html[^].

—SA






参考



如何设置gridview行高 [ ^ ]


这篇关于如何更改GridView的行高的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆