Hi ramco1917,
Set the table cell text-align to center.
Please refer below sample.
HTML
C#
<style type="text/css">
.status { text-decoration: none; }
</style>
<asp:Repeater ID="rptStudents" runat="server">
<HeaderTemplate>
<table>
<tr>
<td>Name</td>
<td>Status</td>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td><asp:Label ID="lblId" Text='<%#Eval("Name") %>' runat="server" /></td>
<td style="text-align: center;">
<asp:LinkButton ID="lnkStatus" runat="server" Text='<%# Eval("Status") == " " ? "-" : Eval("Status") %>'
class="status"></asp:LinkButton>
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
VB.Net
<style type="text/css">
.status { text-decoration: none; }
</style>
<asp:Repeater ID="rptStudents" runat="server">
<HeaderTemplate>
<table>
<tr>
<td>Name</td>
<td>Status</td>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td><asp:Label ID="lblId" Text='<%#Eval("Name") %>' runat="server" /></td>
<td style="text-align: center;">
<asp:LinkButton ID="lnkStatus" runat="server" Text='<%# If(Eval("Status") = " " , "-" , Eval("Status")) %>'
class="status"></asp:LinkButton>
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
Namespace
C#
using System.Data;
VB.Net
Imports System.Data
Code
C#
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
DataTable dt = new DataTable();
dt.Columns.AddRange(new DataColumn[] { new DataColumn("Name"),
new DataColumn("Status")});
dt.Rows.Add("Mudassar Khan", "Pending");
dt.Rows.Add("Robert Richerd", " ");
dt.Rows.Add("Alex", "Dispatch");
dt.Rows.Add("Pandyan", " ");
dt.Rows.Add("Michal Kalls", "Deliver");
rptStudents.DataSource = dt;
rptStudents.DataBind();
}
}
VB.Net
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
If Not Me.IsPostBack Then
Me.BindRepeater()
End If
End Sub
Protected Sub BindRepeater()
Dim dt As DataTable = New DataTable()
dt.Columns.AddRange(New DataColumn() {New DataColumn("Name"), New DataColumn("Status")})
dt.Rows.Add("Mudassar Khan", "Pending")
dt.Rows.Add("Robert Richerd", " ")
dt.Rows.Add("Alex", "Dispatch")
dt.Rows.Add("Pandyan", " ")
dt.Rows.Add("Michal Kalls", "Deliver")
rptStudents.DataSource = dt
rptStudents.DataBind()
End Sub
Screenshot