0

I have this table I created manually, and I want to use a gridview to generate data instead of using a table, the table has round corners in all four corners.

<table border="0"  id="rounded-corner">
<thead>
<tr>

<th scope="col" class="rounded-company">#</th>
<th>RegNum</th>
<th class="rounded-q4">Actions</th>
</tr>
</thead>
<tfoot>
<tr>
<td class="rounded-foot-left">Summary</td>
<td>10</td>
<td  class="rounded-foot-right">some text</td>
</tr>
</tfoot>

Is it possible to use a gridview and still get the table look I wanted?

EDIT

This is the CSS for the table:

/* table */
#rounded-corner
{
    font-family: "Lucida Sans Unicode", "Lucida Grande", Sans-Serif;
    font-size: 12px;    margin: 10px;   width: 571px;
    text-align: left;   border-collapse: collapse;
}
#rounded-corner thead th.rounded-company
{
    background: #b9c9fe url('images/left.png') left -1px no-repeat;
}
#rounded-corner thead th.rounded-q4
{
    background: #b9c9fe url('images/right.png') right -1px no-repeat;
}
#rounded-corner th
{
    padding: 8px;   font-weight: normal;
    font-size: 13px;    color: #039;
    background: #b9c9fe;
}
#rounded-corner td
{
    padding: 8px;   background: #e8edff;
    border-top: 1px solid #fff;     color: #669;
}
#rounded-corner tfoot td.rounded-foot-left
{
    background: #e8edff url('images/botleft.png') left bottom no-repeat;
}
#rounded-corner tfoot td.rounded-foot-right
{
    background: #e8edff url('images/botright.png') right bottom no-repeat;
}
#rounded-corner tbody tr:hover td 
{
    background: #d0dafd;
}
4

1 に答える 1

2

リピーターを利用する

<table border="0"  id="rounded-corner">
<thead>
<tr>
<th scope="col" class="rounded-company">#</th>
<th>RegNum</th>
<th class="rounded-q4">Actions</th>
</tr>
</thead>

<tbody>
    <asp:Repeater runat="server" id="rpt_table1">
    <ItemTemplate>
    <tr>
        <td><%# Eval("foo1")%></td>
        <td><%# Eval("foo2")%></td>
        <td><%# Eval("foo3")%></td>
        <td><asp:Button CommandArgument='<%# Eval("id") %>' OnCommand="btnedit_command" ID="btnedit" Text="Edit" /></td>
    </tr>
    </ItemTemplate>
    </asp:Repeater>
</tbody>

<tfoot>
<tr>
<td class="rounded-foot-left">Summary</td>
<td>10</td>
<td  class="rounded-foot-right">some text</td>
</tr>
</tfoot>

</table>

コード ビハインド .cs

    protected void btnedit_command(object sender, CommandEventArgs e)
    {
        // this is command argument value (ID) --> e.CommandArgument
    }
于 2012-04-16T12:05:55.313 に答える