Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Thin Lines (again) 2

Status
Not open for further replies.

danielh68

Technical User
Joined
Jul 31, 2001
Messages
431
Location
US
Hi.

I know this is a common question. I did a search and read through it, but it still doesn't solve the problem I have.
My problem is this:

When I create a table (lets say, green as a background color), then I create another table within that green one and assign it a background color of gray, I (for some unknown reason) get a white border. I look in the code when I select the table and I don't see FFFFFF. Plus, the border is not flat, it's beveled. Ideally, I want a thin 1 pixel border with a flat color. So, how do I make it a flat line and assign it a unique color?

If, for further clarification, I can post an example. I really appreciate your help.

Thanks,
DanH
 
You could try css, so for example:

style="border-style: solid; border-width: 1px; border-color: red;"

in the table (or tr/td) tag. You can specify the border as pixels (px) or points (pt) etc.
 
Thanks, sweevo.

I suppose CSS could help, although in some other post the guy recommned doing it in the conventional manner. In any case, it doesn't solve my problem with the bevel and color.
To better illustrate what I'm talking about, here's a link.


Remember, it's just a test. Anyhow, I made the border 5 pixels to better see the problem of bevelment. Any advice is much appreciated.

Could it be that I working in UltraDev as opposed to DW?

Thanks,
DanH
 
table width="100%" border="5" cellpadding="0" cellspacing="0" bgcolor="#3300CC"

this is your tag

put border="0" and apply CSS suggested by sweevo Ranjan
fragments of dream, weave them together
 
This worked for me:

<table style=&quot;border-style: solid; border-width: 1px; border-color: red;&quot; bgcolor=&quot;#3300CC&quot;>
 
Hi all!

Haven't tried sweevo's code but I'm sure that CSS style won't work in NS 4.7 and below... There is a better way to do it, if you are interested I'll post it here. Good Luck! :-)
 
Sure. I'm always interested in learning a new approach.

Thanks,
DanH
 
Sure :-)

Here is how I usually do it.

You will need 2 tables - real table with data and another one as a frame for the first one.

1) Insert a table with 1 row and 1 column - one cell table. Set background color of this cell as you want table borders to be. Let's say gray #CCCCCC. So we have:

Code:
<table border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;>
<tr><td bgcolor=&quot;#CCCCCC&quot;> </td></tr>
</table>

This table will be as a frame for the real table with data.

2) Insert real table with data inside the table we've just created. Set width=&quot;100%&quot;, border=&quot;0&quot;, cellspacing=&quot;1&quot; and cellpadding as you need, let's say =&quot;3&quot;. Last thing to do - set background of each row in this table with desired color.
Important: set cellspacing of this table equals to 1 and set background of each row but not the whole table!


Real example:

Code:
<table width=&quot;50%&quot; border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; align=&quot;center&quot;>
  <tr> 
    <td bgcolor=&quot;#CCCCCC&quot;> 
       <table border=&quot;0&quot; cellspacing=&quot;1&quot; cellpadding=&quot;3&quot; align=&quot;center&quot; width=&quot;100%&quot;>
        <tr bgcolor=&quot;#FFFFFF&quot;> 
          <th width=&quot;50%&quot;>Name</th>
          <th width=&quot;50%&quot;>Length (km)</th>
        </tr>
        <tr bgcolor=&quot;#FFFFFF&quot;> 
          <td>River 1</td>
          <td>2145</td>
        </tr>
        <tr bgcolor=&quot;#FFFFFF&quot;> 
          <td>River 2</td>
          <td>1020</td>
        </tr>
      </table></td>
  </tr>
</table>


It's kind of complicated but it looks absolutely the same in all browsers. One more hint - if you set cellpadding=&quot;1&quot; of first table you'll have nice frame for the table.

I'm hope it's understood if not tell me!!! Good Luck! :-)
 
Got it! Thanks Eugene.

--DanH
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top