我怎样才能使文本在gridview列中居中 [英] How can i make the text be centered in a gridview column

查看:617
本文介绍了我怎样才能使文本在gridview列中居中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Heelo伙计们

我现在在gridview中有一列,但标签内的数据未与标题对齐.下面是我的列...如何使文本居中?

Heelo guys

I have a column in a gridview now the data inside label is not centered with my header.Below is my column...How can i make the text be centered?

<asp:TemplateField HeaderText="Employee Name">

          <itemtemplate>

 <asp:Label ID="Label1" runat="server" Text=''<%# Bind("Fullname") %>''>
           </itemtemplate>



代码包装在"pre"标记中[/编辑]



Code is wrapped in "pre" tag[/Edited]

推荐答案

如何:
<asp:TemplateField HeaderText="Employee Name">
<itemtemplate> 
  <asp:Label ID="Label1" runat="server" Text=''<%# Bind("Fullname") %>''>
</itemtemplate>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>



最好的问候
Espen Harlinn



Best regards
Espen Harlinn


这篇关于我怎样才能使文本在gridview列中居中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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