Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,254
Total Threads: 80,792
Total Posts: 566,472
There are 1846 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     HTML/XHTML/DHTML/CSS :

HTML table help.

Thread title: HTML table help.
Closed Thread  
Page 1 of 2 1 2 >
    Thread tools Search this thread Display Modes  
10-10-2005, 11:17 AM
#1
echoepidemic is offline echoepidemic
echoepidemic's Avatar
Status: Graphic Designer
Join date: Apr 2005
Location: Vancouver
Expertise:
Software:
 
Posts: 2,057
iTrader: 0 / 0%
 

echoepidemic is on a distinguished road

Send a message via AIM to echoepidemic Send a message via MSN to echoepidemic

  Old  HTML table help.

How do I make a table look pretty? I'm building a website for a business and they need a table with information in it. I'd like to have the table have just 1 solid 1px grey line instead of the bevel.

Anyone post the code i need?

10-10-2005, 11:24 AM
#2
jamesyfx is offline jamesyfx
Status: Member
Join date: Jan 2005
Location: Manchester
Expertise: Design
Software: TextEdit
 
Posts: 1,009
iTrader: 0 / 0%
 

jamesyfx is on a distinguished road

Send a message via MSN to jamesyfx

  Old

Theres a few different ways.

You could do it in just HTML:

<table cellpadding="6" cellspacing="1" bgcolor="#000000">
<tr>
<td bgcolor="#ffffff">Text</td>
<td bgcolor="#ffffff">Text</td>
</tr>
</table>

The cellspacing creates a 1px area around each cell, and since you're filling the cells in with white.. it looks like theres a border.

Of course you can do it in XHTML and CSS too.

<table class="border" cellpadding="6" cellspacing="1">
<tr>
<td>Text</td>
<td>Text</td>
</tr>
</table>

.border { background-color: #000000;}
td { background-color: #ffffff; }

.. Just mix and match. Whatevers best for you.

10-10-2005, 11:26 AM
#3
seen.to is offline seen.to
seen.to's Avatar
Status: unusual suspect ™
Join date: Feb 2005
Location: Lancaster, PA from London UK
Expertise:
Software:
 
Posts: 1,814
iTrader: 0 / 0%
 

seen.to is on a distinguished road

  Old

.tableName {
border: 1px solid #ccc;
}

10-10-2005, 11:29 AM
#4
jamesyfx is offline jamesyfx
Status: Member
Join date: Jan 2005
Location: Manchester
Expertise: Design
Software: TextEdit
 
Posts: 1,009
iTrader: 0 / 0%
 

jamesyfx is on a distinguished road

Send a message via MSN to jamesyfx

  Old

Oh, you mean just one border around the entire table?

Whoops. The first method covers every cell.

10-10-2005, 08:45 PM
#5
echoepidemic is offline echoepidemic
echoepidemic's Avatar
Status: Graphic Designer
Join date: Apr 2005
Location: Vancouver
Expertise:
Software:
 
Posts: 2,057
iTrader: 0 / 0%
 

echoepidemic is on a distinguished road

Send a message via AIM to echoepidemic Send a message via MSN to echoepidemic

  Old

I wanted it to cover every cell.

10-10-2005, 09:17 PM
#6
sysblnk is offline sysblnk
Status: I love this place
Join date: Mar 2005
Location:
Expertise:
Software:
 
Posts: 640
iTrader: 0 / 0%
 

sysblnk is on a distinguished road

  Old

You can also use td { border: 1px solid #CCC; } but that will overlap cells giving some parts a two pixel border. What I do is give certain cells different classes. For example:

.firstCell {
border: 1px solid #CCC;
}
.cells {
border-top: 1px solid #CCC;
border-bottom: 1px solid #CCC;
border-right: 1px solid #CCC;
}

Of course if you have more than one row you need to take off the top border in the new rows.

10-10-2005, 10:19 PM
#7
xZaft is offline xZaft
Status: Member
Join date: Jul 2005
Location: Massachusetts, US
Expertise:
Software:
 
Posts: 428
iTrader: 0 / 0%
 

xZaft is on a distinguished road

  Old

And, on the first row cells, add a top border.

10-10-2005, 10:20 PM
#8
jamesyfx is offline jamesyfx
Status: Member
Join date: Jan 2005
Location: Manchester
Expertise: Design
Software: TextEdit
 
Posts: 1,009
iTrader: 0 / 0%
 

jamesyfx is on a distinguished road

Send a message via MSN to jamesyfx

  Old

Sounds a bit more complicated.

Doing it just with html means you dont have to faff about with borders and stuff. It's just assured tom be 1px all the time.

10-10-2005, 11:01 PM
#9
johniman7 is offline johniman7
Status: Junior Member
Join date: Sep 2005
Location:
Expertise:
Software:
 
Posts: 25
iTrader: 0 / 0%
 

johniman7 is on a distinguished road

Send a message via AIM to johniman7

  Old

Why not use a div?

10-10-2005, 11:16 PM
#10
Salathe is offline Salathe
Salathe's Avatar
Status: Community Archaeologist
Join date: Jul 2004
Location: Scotland
Expertise: Software Development
Software: vim, PHP
 
Posts: 3,820
iTrader: 25 / 100%
 

Salathe will become famous soon enough

Send a message via MSN to Salathe

  Old

You might like to check out the source for the CSS Table Gallery.

Closed Thread  
Page 1 of 2 1 2 >


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed