Can you make a datagrid look good?

VBAHole22

Contributor
Joined
Oct 21, 2003
Messages
432
Location
VA
Does anyone have any good links or information about using css in datagrids?
I'm trying to make a professional looking datagrid but it's tough. There are attributes that can be applied in the html declaration of the datagrid (like CellPadding) but that seemingly can't be contained in a css style declaration. Is this true?
Does anyone have a nice looking template that they want to share with me? I'll make you famous. Your name in lights.
I don't want to go with one of those off the shelf formats. I'd rather do it myself. I just need a listing of the tags and what they do to help me out.
Would I be better off creating my own datagrid deriving from the MS one?

Thanks for any suggestions. I appreciate it. I realize it's lame to just beg for code but it would save me a ton of time and I have spent hours googling 'css datagrid' without much luck.
 
You may want to look into the repeater control. I have had much success with it vs. the datagrid.

Code:
<asp:Repeater id="ExampleRepeater" runat="server">
	<HeaderTemplate>
		<table cellpadding="0" cellspacing="0" width="780">
			<tr>
				<td>
					<p class="title">Title for Shown Data</p>
				</td>
			</tr>					
	</HeaderTemplate>
	<ItemTemplate>
			<tr bgcolor="ffffff">
				<td>
					<p>Your Text Here</p>
				</td>
			</tr>
	</ItemTemplate>
	<AlternatingItemTemplate>
			<tr bgcolor="dcdcdc">
				<td>
					<p>Your Text Here</p>
				</td>
			</tr>
	</AlternatingItemTemplate>
	<FooterTemplate>
		</table>
	</FooterTemplate>
</asp:Repeater>

This code seems to make errors in VS.NET, but when you run it it works anyway. I have not been able to determine why the errors are caused, all I know is that the code works for me.
 
Back
Top