Jump to content

Two tables, two looks


Borderline
 Share

Recommended Posts

Good evening.I'm looking for some advice: I have two tables on one page, but I was hoping to get two different looks for the tables. The "in progress" link is here: http://www.further-flight.co.uk/features/p.../2011-01-04.phpI found this tutorial http://www.loriswebs.com/html-tips/format-tables-css.html, and tried to use it with my code, but it's not getting me the desired effect (second table on the page should have no borders). Could someone point me in the right direction, please?The CSS

/*------  TABLES  ------*/table{border-collapse:collapse;}table,th,td{border: 2px solid black;padding: 0px 0px 0px 5px;text-align: left;}tr{height:25px;} .table1 {	border:none; }.toprow{	background: black url(/images/blockactive.gif) center center repeat-x;	color: #FFFFFF;	font: bold 1em arial, verdana, sans-serif;}.leftcol{	background: #C0C0C0;	font: bold 1em arial, verdana, sans-serif;}	.spacecol{	background: #FFFFFF;	font: bold 1em arial, verdana, sans-serif;	border-left: none;}

The second table:

	<table class='table1' width='75%'>			<?php	while($info = mysql_fetch_array($data)) {  		// links		$link='/features/previews/trainers.php';		$tctext='Add Trainer Comment';	?>				<?phpif (!empty($info['trainercomment']) ) { 		?>							<tr>				<td><?php echo $info['horse']; ?></td>				</tr>								<tr>				<td>				<?php echo $info['comment']; ?>				</td></tr>								<tr>				<td class='trainercomment' bgcolor='#FFFFB9'>				Comments from <?php echo $info['trainer']; ?>:  <?php echo $info['trainercomment']; ?>				</td>								<tr class='plaintable'>				<td> </td>				</tr>				<?php					}			else			{		?>							<tr>				<td><?php echo $info['horse']; ?></td>				</tr>								<tr>				<td>				<?php echo $info['comment']; ?>				</td></tr>												<tr>				<td> </td>				</tr>				 </tr>		<?php		}  		?>			<?php	}  	?>			</table>

Any advice gratefully received!

Link to comment
Share on other sites

You are only resetting the border for the table itself. All of its cells still have borders. Try this:.table1, .table1 td, .table1 th { border:none;}That will also target any td or th element that is a descendant of .table1

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...