Forum Moderators: open

Message Too Old, No Replies

How can I create nice table borders like Microsoft site

         

midi25

10:06 pm on Jan 21, 2003 (gmt 0)

10+ Year Member



Hi how can I create nice slim borders on my tables. I would like to have borders like on Microsofts site.

I have noticed alot of sites now have table borders that are ultra slim. The HTML code i am using is just adding thick lines around my table.

<table width="120" bordercolor="#0066FF" border="1">

What can I do to get ultra slim borders.

Please help

DrDoc

10:11 pm on Jan 21, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The answer is (drum roll) - CSS!

If possible, use DIVs instead of tables. Otherwise, style your tables using CSS. Either way, here's the solution:

style="border:solid 1px #cccccc;"

For example, consider this DIV:

<div style="border:solid 1px #cccccc;height:300px;width:120px;">Some text here!</div>

midi25

10:27 pm on Jan 21, 2003 (gmt 0)

10+ Year Member



Thanks have sorted it.

Funny I know asp and vb6 yet have never bothered to learn how to do such a simple thing as that.

Thanks Its worked fine now. CSS looks good.

aspdaddy

10:35 pm on Jan 21, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You could also use this in your table tag:

frame="void" rules="rows" border="1"

martinibuster

12:32 am on Jan 22, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Not sure if the css examples are backward compatible to NN 4.7.

If that's an issue then you can nest a pair of tables, with the inner table 2px smaller in the width and height. Then set the background color of the larger outer table to black, or whatever line color that you want.

kiwanji

4:02 am on Jan 22, 2003 (gmt 0)

10+ Year Member



DrDoc-

That is a very cool way to sort out content without using tables but how would you build multiple rows and columns, etc. like when we use tables?

Thanks-

WibbleWobble

1:14 pm on Jan 22, 2003 (gmt 0)

10+ Year Member



style="border:solid 1px #cccccc;"

I'm not entirely sure, but technically, shouldn't it be border:[width] [style] [colour]; - though it probably doesn't make much difference to "clever" browsers (read: ones that compensate for errors)

WW.

limbo

3:46 pm on Jan 22, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Or you could try this:

<table width="100" border="0" cellpadding="0" cellspacing="1" bgcolor="#000000">
<tr>
<td bgcolor="#FFFFFF">&nbsp;</td>
</tr>
</table>

the cell spacing (set to 1) becomes your "border"

I think this works in most browsers

DrDoc

6:44 pm on Jan 22, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



WibbleWobble, you're right. Thanks for catching that. It should be border: 1px solid #cccccc;