User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the HTML and CSS section within the Web Development category of DaniWeb, a massive community of 427,196 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,159 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our HTML and CSS advertiser: Lunarpages Web Hosting
Views: 795 | Replies: 3
Reply
Join Date: Dec 2004
Location: India
Posts: 234
Reputation: cancer10 is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
cancer10's Avatar
cancer10 cancer10 is offline Offline
Posting Whiz in Training

Question How to draw these borders

  #1  
Mar 11th, 2008
I like the borders of the forums like this. Can someone tell me how to draw a border in HTML/CSS as shown in the screenshot.



[IMG]http://img91.imageshack.us/img91/3292/fireshotcapture12helloimn7.th.jpg[/IMG]

I would like to have the bordercolor as well. The following HTML does not work perfectly on all browsers

I mean, with

FF - The code works fine
IE - Works but displays a thicker border compared to FF
Opera - Does not show the border color



<table border=1 bordercolor="#6E94B7" cellspacing=0 cellpadding=0>
<tr><td>Hello 1</td><td>Hello 2</td><td>Hello 3</td></tr>
<tr><td>Hello 4</td><td>Hello 5</td><td>Hello 6</td></tr>
<tr><td>Hello 7</td><td>Hello 8</td><td>Hello 9</td></tr>
<tr><td>Hello 10</td><td>Hello 11</td><td>Hello 12</td></tr>
</table>


Please help

Thanx
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jan 2007
Posts: 2,556
Reputation: MidiMagic is on a distinguished road 
Rep Power: 7
Solved Threads: 115
MidiMagic's Avatar
MidiMagic MidiMagic is offline Offline
Posting Maven

Re: How to draw these borders

  #2  
Mar 11th, 2008
Originally Posted by cancer10 View Post
I like the borders of the forums like this. Can someone tell me how to draw a border in HTML/CSS as shown in the screenshot.

I would like to have the bordercolor as well. The following HTML does not work perfectly on all browsers

I mean, with

FF - The code works fine
IE - Works but displays a thicker border compared to FF
Opera - Does not show the border color

<table border=1 bordercolor="#6E94B7" cellspacing=0 cellpadding=0>
<tr><td>Hello 1</td><td>Hello 2</td><td>Hello 3</td></tr>
<tr><td>Hello 4</td><td>Hello 5</td><td>Hello 6</td></tr>
<tr><td>Hello 7</td><td>Hello 8</td><td>Hello 9</td></tr>
<tr><td>Hello 10</td><td>Hello 11</td><td>Hello 12</td></tr>
</table>

Please help

Thanx


Use stylesheets instead of the deprecated border and bordercolor attributes of the table tag:

<html>
<head>
<title>My Title</title>
<style type="text/css">
.tablebord {border: 1px #6e94b7 solid; border-collapse: collapse;}
</style>
</head>
<body>

<table class="tablebord">
 <tr><td>Hello 1</td><td>Hello 2</td><td>Hello 3</td></tr>
 <tr><td>Hello 4</td><td>Hello 5</td><td>Hello 6</td></tr>
 <tr><td>Hello 7</td><td>Hello 8</td><td>Hello 9</td></tr> 
 <tr><td>Hello 10</td><td>Hello 11</td><td>Hello 12</td></tr>
</table>

</body>
</html>
Last edited by MidiMagic : Mar 11th, 2008 at 1:28 pm.
Daylight-saving time uses more gasoline
Reply With Quote  
Join Date: Nov 2003
Location: California
Posts: 203
Reputation: rixius is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 1
rixius rixius is offline Offline
Posting Whiz in Training

Re: How to draw these borders

  #3  
Mar 13th, 2008
You forgot to give him the css to use with that. : )

tablebord { border: 1px solid #6E94B7; }

I wouldn't use this, however, because it fails to put the borders between cells.

If you want to have a cross thatched border, set the background of the table element to the border color, and change the cellspacing to 1.

That should do it for you.
Reply With Quote  
Join Date: Jan 2007
Posts: 2,556
Reputation: MidiMagic is on a distinguished road 
Rep Power: 7
Solved Threads: 115
MidiMagic's Avatar
MidiMagic MidiMagic is offline Offline
Posting Maven

Re: How to draw these borders

  #4  
Mar 15th, 2008
I forgot to put it in the td tags too. I was sleepy at the time.

<html>
<head>
<title>My Title</title>
<style type="text/css">
.tablebord {border: 1px #6e94b7 solid; border-collapse: collapse;}
</style>
</head>
<body>

<table class="tablebord">
  <tr>
    <td class="tablebord">Hello 1</td>
    <td class="tablebord">Hello 2</td>
    <td class="tablebord">Hello 3</td>
  </tr>
  <tr>
    <td class="tablebord">Hello 4</td>
    <td class="tablebord">Hello 5</td>
    <td class="tablebord">Hello 6</td>
  </tr>
  <tr>
    <td class="tablebord">Hello 7</td>
    <td class="tablebord">Hello 8</td>
    <td class="tablebord">Hello 9</td>
  </tr> 
  <tr>
    <td class="tablebord">Hello 10</td>
    <td class="tablebord">Hello 11</td>
    <td class="tablebord">Hello 12</td>
  </tr>
</table>

</body>
</html>
Daylight-saving time uses more gasoline
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb HTML and CSS Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the HTML and CSS Forum

All times are GMT -4. The time now is 10:28 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC