PDA

View Full Version : Table borders


murphyz
08-12-2002, 11:11 AM
I have a table with two cells, in rows, so one cell is on top of the other. I want a border for the table to appear all on the outside, but I want the border in between cells to remain blank...so it basically looks like a black box but there are two cells inside where I can put a picture in one cell and a background picture in the other.

My attempts seem to put a border around each cell, not just the table as a whole - how can I keep that one line blank?

Thanks

Murphyz

Morgoth
08-12-2002, 11:27 AM
If your table code looks like:


<table border=1>
<tr>
<td>
1
</td>
</tr>
<tr>
<td>
2
</td>
</tr>
</table>


Then it will put the line in the center, between the cells.

I think the best thing for you to do, is use 2 tables:

<table border=1>
<tr>
<td>

<table border=0>
<tr>
<td>
1
</td>
</tr>
<tr>
<td>
2
</td>
</tr>
</table>


</td>
</tr>
</table>


Does this help?

murphyz
08-12-2002, 11:32 AM
Never even crossed my mind to use two tables...as long as the tables stay together in any browser it will be fine - I will be cutting an image that needs to appear together, which is why I was attempting to use one table and didn't want the border.
I haven't got the site I am working on here (at work) so will try it later.

Thank you

Mxx

Morgoth
08-12-2002, 11:41 AM
No Problem.
I'm glad I could help you.
Don't forget about your cellspacing and cellpadding.

realfargone
08-12-2002, 01:29 PM
This is the method I've see used for getting a border around a table on various sites in the past. Very similar to the previous method in that its a nested table.


<table width="300" cellpadding="1" cellspacing="0" border="0" bgcolor="#000000">
<tr>
<td>
<table width="300" cellpadding="0" cellspacing="0" border="0" bgcolor="#ffffff">
<tr><td>1</td></tr>
<tr><td>2</td></tr>
</table>
</td>
</tr>
</table>


--
r/f/g

murphyz
08-12-2002, 01:38 PM
Thank you, that's perfect.

Mxx

justame
08-12-2002, 07:23 PM
mur...
sayyy your image width is 250???
you coulddd put them both in the 'same' cell of ONE table ifin' your table is 250 wide...
by default??? the twooo images would just a lignŽ up one under the other sorta like if you would have used the ol' <br> tag...
<table width="250" border="1" cellpadding="0" cellspacing="0">
<tr><td><img 1 width="250"...etc><img 2 width="250"... etc></td></tr></table>

murphyz
08-13-2002, 09:23 AM
Yes, but I need the top image to be set as background so text scrolls over the top...thanks anyway.

Mxx

Morgoth
08-13-2002, 10:41 AM
Originally posted by realfargone
This is the method I've see used for getting a border around a table on various sites in the past. Very similar to the previous method in that its a nested table.


<table width="300" cellpadding="1" cellspacing="0" border="0" bgcolor="#000000">
<tr>
<td>
<table width="300" cellpadding="0" cellspacing="0" border="0" bgcolor="#ffffff">
<tr><td>1</td></tr>
<tr><td>2</td></tr>
</table>
</td>
</tr>
</table>


--
r/f/g


This works great, and I was looking for this code to make the border thinner, but just so you don't use two tables all the time to make the thinner border, I was showed a style tag.


This doesn't help with your first question, but you seemed to like the thin border. Use this code for anything else that only requirers one table.
http://www.codingforums.com/showthread.php?s=&postid=17955