Anyone have any styled tables they can provide?

Discussion in 'CSS' started by Artifexus, Sep 3, 2010.

  1. #1
    I'm looking for a pretty simple styled table for my website.

    White, horizontal gridlines (light grey), and maybe a blue or grey top row.

    Does anyone have such table they would be willing to share the html/css for?

    Any help would be appreciated.

    Thanks.
     
    Artifexus, Sep 3, 2010 IP
  2. jpratama

    jpratama Member

    Messages:
    31
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #2
    Like this ?
    <style type="text/css">
    table {
    	width: 100%;
    }
    table thead tr th {
    	background-color: lightblue;
    	padding: 5px;
    }
    table tbody tr td {
    	border-bottom: solid 1px lightgrey;
    	padding: 5px;
    }
    </style>
    <table cellpadding="0" cellspacing="0">
    	<thead>
    		<tr>
    			<th>Some Text Some Text Some Text</th>
    			<th>Some Text Some Text Some Text</th>
    			<th>Some Text Some Text Some Text</th>
    		</tr>	
    	</thead>
    	<tbody>
    		<tr>
    			<td>Some Text Some Text Some Text</td>
    			<td>Some Text Some Text Some Text</td>
    			<td>Some Text Some Text Some Text</td>
    		</tr>
    		<tr>
    			<td>Some Text Some Text Some Text</td>
    			<td>Some Text Some Text Some Text</td>
    			<td>Some Text Some Text Some Text</td>
    		</tr>
    	</tbody>
    </table>
    HTML:
     
    jpratama, Sep 4, 2010 IP
    Artifexus likes this.
  3. radiant_luv

    radiant_luv Peon

    Messages:
    1,327
    Likes Received:
    34
    Best Answers:
    1
    Trophy Points:
    0
    #3
    radiant_luv, Sep 4, 2010 IP
    Artifexus likes this.
  4. Artifexus

    Artifexus Active Member

    Messages:
    257
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    58
    #4
    Thank you both - rep added.

    jpratama, I'm actually using your table. I added rows and columns, but for some reason, the bottom border only shows up on the first 3 columns of every row - the columns that were in your original code. Do you know what gives?

    I'm using the table in a wordpress page, and I added the CSS to the style.php file.

    Any help would be appreciated.

    Thanks again.
     
    Artifexus, Sep 12, 2010 IP
  5. wd_2k6

    wd_2k6 Peon

    Messages:
    1,740
    Likes Received:
    54
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Hi,

    I'd check you were inserting the new columns correctly, post your code up here so we can double-check!
     
    wd_2k6, Sep 14, 2010 IP
  6. Artifexus

    Artifexus Active Member

    Messages:
    257
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    58
    #6
    Ah, I figured it out, thanks!
     
    Artifexus, Sep 14, 2010 IP