如何更改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 oftd
and/ortr
elements. How? Start here:
http://www.w3.org/TR/CSS2/box.html[^].—SA
参考
如何设置gridview行高 [ ^ ]