SitePoint Sponsor |
|
User Tag List
Results 1 to 4 of 4
Thread: Tables with CSS?
-
Jun 15, 2005, 07:41 #1
- Join Date
- Jun 2005
- Posts
- 3
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Tables with CSS?
Hey everyone,
This is my first post here and I'm a little confused with my tables here. Here's what I have:
<style type="text/css">
body, table {font-size:8pt; font-family:arial; font-color:black}
</style>
<table cellpadding="3">
<tr bgcolor="#CCCCCC"><td><b>Artist</b></td><td><b>Album Name</b></td></tr>
<tr bgcolor="#6BBDCB"><td>An Albatross</td><td>We Are the Lazer Viking</td></tr>
<tr bgcolor="#9AD2DC"><td>Brazil</td><td>A Hostage And the Meaning of Life</td></tr>
<tr bgcolor="#6BBDCB"><td>De Facto</td><td>Megaton Shotblast</td></tr>
<tr bgcolor="#9AD2DC"><td>Fatal Flying Guilloteens</td><td>Split EP</td></tr>
</table>
-
Jun 15, 2005, 08:55 #2
- Join Date
- May 2005
- Location
- Cardiff
- Posts
- 1,832
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
First off, you could use table headings for the Artist and the Album name, eg:
Code:<tr> <th>Artist</th> <th>Album</th> </tr>
Code:th {font-weight:bold; background:#CCCCCC;}
-
Jun 15, 2005, 09:34 #3
- Join Date
- Jan 2003
- Location
- Hampshire UK
- Posts
- 40,556
- Mentioned
- 183 Post(s)
- Tagged
- 6 Thread(s)
Hi,
You could just place a striped background behind the table that repeats vertically.
e.g.
http://www.pmob.co.uk/temp/alternate-rows-css.htm
However that will soon break if the user resizes the text with the browser controls.
You could also do it with javascript as follows (not my js btw):
http://www.pmob.co.uk/temp/alternate-rows-js.htm
Obviously a serverside solution would be similar and more robust.
Hope it helps.
-
Jun 15, 2005, 09:54 #4
- Join Date
- Jul 2003
- Location
- Springfield, MO
- Posts
- 1,867
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
If you're pulling from a database w/ ASP.NET I can show you how to do this in about two minutes
.
P.S.: You'll probably want to PM me if you go server side b/c I'm working with Flash at the moment and we're not getting along and I'll forget to re-check the thread.
Bookmarks