Phani
Phani

Reputation: 95

First column to left and remaining columns to right in GridView

How do I display first column in left and remaining columns to the right in Gridview?

Upvotes: 1

Views: 1296

Answers (1)

Madhu Beela
Madhu Beela

Reputation: 2215

Try this using css

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">
        .gridview tr td
        {
            text-align: right;
        }
        .gridview tr td:first-child
        {
            text-align: left;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:GridView ID="GridView1" CssClass="gridview" runat="server">
        </asp:GridView>
    </div>
    </form>
</body>
</html>

hope it helps !!!

Upvotes: 6

Related Questions