View Full Version : BORDERCOLOR alternative?
trenzterra
October 21st, 2002, 03:52
You know that bordercolor thingy that works in tables in IE?
It doesn't work with netscape and opera.
What alternative do people use? I've seen those black border lines and stuff. How do i do that?
aphel aura
October 21st, 2002, 11:53
Use CSS to apply borders in tables. They works in all browsers.
Dusty
October 21st, 2002, 14:29
You could use two tables instead of one. That works in all browser, even those that don't support CSS (assuming, of course, they do support tables). A thin black line "border" could be done like this:
<table border="0" cellpadding="1" cellspacing="0"><tr><td bgcolor="#000000">
<table border="0" cellpadding="5" cellspacing="0"><tr><td bgcolor="#FFFFFF">
Content Here
</td></tr></table>
</td></tr></table>
This forum uses a similar method to make its thin gray line borders.
Ashed
October 21st, 2002, 14:38
Actually you have to set the bgcolor for the outer table and set cellspacing to 1 for the inner table. You don't need to set the cellpadding for the outer one, too. :)
Dusty
October 21st, 2002, 14:49
I said "could", not "had to". There are other ways that work similarly but not exactly the same. Yours works by using the cellspacing of the inner table to make the border, mine makes the border by using the cellpadding of the outer table, but they both create the same illusion of a table border.
But you do need to set the bgcolor for both, as I said. You can't just do the outer one. I think that's what you meant, but your post is a little unclear.
trenzterra
October 21st, 2002, 21:34
Well but this isn't the effect I want. I want to to cover all the tds and trs as well. How do I do it with the two table thingy?
See attachment below...
Also if I do it with CSS, it gets the line thicker as it overlaps. How?
Dusty
October 21st, 2002, 21:52
For that you'd want to do it the other way, the way GRiN was describing. Change all the 90% widths to 100%, remove the borders, make the cellspacing 1, then add this table around the whole thing:
<table border="0" cellpadding="0" cellspacing="0" bgcolor="#009900" width="90%"><tr><td>
...
</td></tr></table>
You could do it the other way, but if you want to see the cell divisions this one's less complicated.
trenzterra
October 21st, 2002, 23:45
i use cellpadding 0 and nothing shows up?
[edit works now]
anyway how do i make the css way overlap each other instead of making the borders thicker?
aphel aura
October 22nd, 2002, 03:48
You can't make borders overlap, but you can choose which side of tables you want to have borders to appear, like right-only or above-and-below only borders.
Take a look at http://peorth.ahmygoddess.net/example.html . The page have 2 adjacent tables. I've bordered the top table using a single css style (applied directly to <table> element), while I bordered the table below using 2 styles (applied to <table> and <td> elements). Feel free to take a look at the source code and see how exactly I bordered the tables without any overlap lines
trenzterra
October 23rd, 2002, 10:48
it seems that when i use the overlap method over a table inside a table, the bgcolor overides the whole table instead of just the border!
aphel aura
October 23rd, 2002, 10:57
The inside tabe bgcolor must also be colored, not only the outside table bgcolor.
<table width="50%" border="0" cellpadding="1" cellspacing="0" bgcolor="#000000">
<tr>
<td><table width="100%" border="0" cellpadding="2" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td>Contents here.</td>
</tr>
</table></td>
</tr>
</table>
trenzterra
October 23rd, 2002, 11:06
Why do borders don't show up for this?:
<table border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="black"><tr><td>
<TABLE border="0" cellpadding="1" cellspacing="1" width="100%" bgcolor="white">
[edit] i tried setting cellpadding to 1 it worked by it doesn't show up the lines for table cells inside.
Dusty
October 23rd, 2002, 11:11
:confused: Didn't we just cover this?
If you're working with the outer table, use the cellpadding. The outer table will put a border around the table as a whole, not the individual cells. If you're working with the inner table, use the cellspacing. The inner table will put a border around everything. You've got it reversed.
trenzterra
October 23rd, 2002, 11:15
So I got this damn html file i need help with. It didn't work for the table inside the table...
In fact, no borders show if i use the inner table method for that fully featured table..
See the url below and i would be grateful for help.
http://trenzter.u23.hostingextreme.com/dlmircscripts2.txt
aphel aura
October 23rd, 2002, 11:19
It will only show outside borders with the example I used. If you want to show borders inside table 'cells', look at this example below
<table width="50%" border="0" cellpadding="0" cellspacing="1" bgcolor="#000000">
<tr>
<td><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td>Contents here</td>
</tr>
</table></td>
<td><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td>Contents here</td>
</tr>
</table></td>
</tr>
</table>
it's a little bit different than the previous example.
trenzterra
October 23rd, 2002, 11:20
But what you used was tables, not table cells
Dusty
October 23rd, 2002, 11:24
You've got a number of problems. 1) You're missing a number of <tr>'s and <td>'s, at least two of each. 2) You've still got it backwards. The cellspacing and padding of the outer table should both be zero. The cellspacing of the inner table should be one. 3) Apply the bgcolor to the <td> tag, not the <table> tag. You can do it like that for the outer table method, but not the inner.
trenzterra
October 23rd, 2002, 11:29
thanks it should work fine now.
<table width="50%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<td bgcolor="Blue">Contents here</td>
</tr><tr>
<td bgcolor="blue">Contents here</td>
</tr>
</table></td>
</tr>
</table>
is the right coding right?
Dusty
October 23rd, 2002, 11:31
Yes, that would make a blue table with a white border and cell divisions.
trenzterra
October 23rd, 2002, 11:34
Originally posted by Dusty
Yes, that would make a blue table with a white border and cell divisions. Now i understand. i never noticed that my outer layer also used bgcolor stuff. Thanks for your help!
Powered by vBulletin® Version 4.1.7 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.