I have a DataList and I have added a datatable in back end. How can I add css to this table?

<asp:DataList ID="DataList1" runat="server" RepeatColumns = "3">
    <ItemTemplate>
        <%# DataBinder.Eval(Container.DataItem, "StringValue") %>
    </ItemTemplate>
</asp:DataList>

    Function CreateDataSource() As ICollection
        'create a DataTable
        Dim dt As DataTable = New DataTable
        dt.Columns.Add(New DataColumn("StringValue", GetType(String)))
        Dim dr As DataRow
        ...

            While reader.Read()
                dr = dt.NewRow()
                dr(0) = "test"
                dt.Rows.Add(dr)
                CreateDataSource = New DataView(dt)
            End While

    End Function

IIRC a datalist just outputs a html table. So look at the generated html source and you'll know for sure.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.