Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 02-06-2005, 02:54 PM   #1 (permalink)
Wysocki
Recruit
 
Join Date: Jan 2005
Location: Covina, CA
Posts: 23
Wysocki is on a distinguished road
How to get single line in tables?

Code:
<html>
<head>
</head>
<body bgcolor="#EEFFEE">
<table width="25%" style="border-collapse: collapse; background-color: #CCFFCC;" border="1">
<tbody><tr>
    <th width="50">a</th>
    <th width="80">b</th>
</tr>
<tr>
    <td width="50">1</td>
    <td width="80">2</td>
</tr>
<tr>
    <td width="50">3</td>
    <td width="80">4</td>
</tr>
</tbody>
</table>
</div>
</body></html>
With the above code I'm able to get a table that has single lines in it instead of the double lines when I just have border="1". The problem is that it looks different in Mozilla an IE. In Mozilla, I get nice black border lines, in IE the lines are white. Since the table is green you can still see them but is there any way to have both browsers see a table with single black lines?
Wysocki is offline   Reply With Quote
Old 02-06-2005, 04:15 PM   #2 (permalink)
idx
Senior Grasshopper
 
idx's Avatar
 
Join Date: Jun 2003
Location: FL
Posts: 317
idx is on a distinguished road
This seems pretty similar in IE5.5 and Moz Firefox 1.0:
Code:
<html>
<head>
</head>
<body bgcolor="#EEFFEE">
<style>
<!--
  table, td {
    border: 1px solid #000;
    border-collapse: collapse;
  }
//-->
</style>
<table width="25%" border="0">
<tbody><tr>
    <th width="50">a</th>
    <th width="80">b</th>
</tr>
<tr>
    <td width="50">1</td>
    <td width="80">2</td>
</tr>
<tr>
    <td width="50">3</td>
    <td width="80">4</td>
</tr>
</tbody>
</table>
</div>
</body></html>
idx is offline   Reply With Quote
Old 02-06-2005, 04:30 PM   #3 (permalink)
Wysocki
Recruit
 
Join Date: Jan 2005
Location: Covina, CA
Posts: 23
Wysocki is on a distinguished road
Thanks for the great solution! But I wanted the table to be a different color than the background. With your code, I went into the cells and added back the pale green color. When I saw the page it was an ugly yellow-green. Any idea why the color in the cells changed? Even with the cells set to #FFFFFF they are a deep yellow.

Code:
<html>

<html>
<head>
</head>
<body bgcolor="#EEFFEE">
<style>
<!--
  table, td {
    border: 1px solid #000;
    border-collapse: collapse;
  }
//-->
</style>
<table width="25%" border="0">
<tbody><tr>
    <th bgcolor="#CCFFCC width="50">a</th>
    <th bgcolor="#CCFFCC width="80">b</th>
</tr>
<tr>
    <td bgcolor="#CCFFCC width="50">1</td>
    <td bgcolor="#CCFFCC width="80">2</td>
</tr>
<tr>
    <td bgcolor="#CCFFCC width="50">3</td>
    <td bgcolor="#CCFFCC width="80">4</td>
</tr>
</tbody>
</table>
</div>
</body></html>
Wysocki is offline   Reply With Quote
Old 02-06-2005, 05:14 PM   #4 (permalink)
idx
Senior Grasshopper
 
idx's Avatar
 
Join Date: Jun 2003
Location: FL
Posts: 317
idx is on a distinguished road
Yeah, no closing quote after the #ccffcc.. Although you can easily adjust the color from css and not have to specify it on each row.

Code:
<style>
<!--
  table, td {
    border: 1px solid #000;
    border-collapse: collapse;
    background-color: #ccffcc;
  }
//-->
</style>
-r
idx is offline   Reply With Quote
Old 02-06-2005, 10:46 PM   #5 (permalink)
Wysocki
Recruit
 
Join Date: Jan 2005
Location: Covina, CA
Posts: 23
Wysocki is on a distinguished road
Damn! It must be the sleep deprivation! I'm starting to lose control over the basics while I'm trying to get more advanced. This is a great solution, but where would you suggest is the best place that I can find more tutorial/info about the <style> stuff, I've just been a basic html guy to this point.
Wysocki is offline   Reply With Quote
Old 02-07-2005, 06:51 PM   #6 (permalink)
idx
Senior Grasshopper
 
idx's Avatar
 
Join Date: Jun 2003
Location: FL
Posts: 317
idx is on a distinguished road
Well the official source is http://w3c.org/Style/CSS/ .. They seem to have some FAQ/articles/tutorials that might help.

I'm, by far, nowhere close to knowledgeable on design, but I ended up going through enough tutorials and ripping other pages apart to make things work.

-r
idx is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
writting progress to cl on one line sde Linux / BSD / OS X 4 11-08-2004 02:15 PM
Silly Question: Adding a line break in a string JeC PHP 4 03-17-2003 11:06 AM
cgi script Henry PHP 25 12-30-2002 07:54 AM


All times are GMT -8. The time now is 01:24 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0 RC8 ©2007, Crawlability, Inc.





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting