Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
using divs instead of a table for tabular data?
Old 08-16-2009, 09:38 AM using divs instead of a table for tabular data?
Webmaster Talker

Posts: 611
Trades: 0
hi, i have to recreate a table with tabular data in it, and i was wondering if there is a way to do this without using a table. i thought of nesting divs, but if each div has a border, that's going to look wrong. the borders will overlap etc. so should i just use a table? here is the page im talking about. i have to reproduce something like this. any advice greatly appreciated. thanks. derek

http://www.loporchios.com/sweats.htm
silverglade is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-16-2009, 09:45 AM Re: using divs instead of a table for tabular data?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,371
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Use a table, it's what they are meant for.

There really is no point in designing a special screwdriver when all you need is a hammer!
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 08-17-2009, 11:57 AM Re: using divs instead of a table for tabular data?
Webmaster Talker

Posts: 611
Trades: 0
ok great thank you chris. derek
silverglade is offline
Reply With Quote
View Public Profile
 
Old 08-25-2009, 02:57 AM Re: using divs instead of a table for tabular data?
Novice Talker

Posts: 5
Name: Jeremy
Trades: 0
ya thats the only situation where you need to use a table :P its recommended lol anything else would just be a headache
pixeldezigns is offline
Reply With Quote
View Public Profile
 
Old 08-25-2009, 10:18 AM Re: using divs instead of a table for tabular data?
Junior Talker

Posts: 1
Trades: 0
Here's some cool css I use for tables. It's a good way to make cleaner borders on tables.

table.data{
border-top: solid 1px black;
border-left: solid 1px black;
}


table.datatd {
border-right: solid 1px black;
border-bottom: solid 1px black;
}
MtnBiker is offline
Reply With Quote
View Public Profile
 
Old 09-04-2009, 02:13 PM Re: using divs instead of a table for tabular data?
portkey's Avatar
Skilled Talker

Posts: 55
Name: Erica Dion
Trades: 0
Tables I think use less code but if you want the speed and look of DIVs here's how I've done it in the past:

Code:
<div style="display:block;clear:both;">
   <div style="float:left;width:30%;">
      Col. One
   </div>
   <div style="float:left;width:50%;">
      Col. Two
   </div>
   <div style="float:right;width:20%;">
      Col. Three
   </div>
</div>
It is a lot of code so if you decide to use a table, I definitely wouldn't use the built in border because it does look messy. I also supplied some code below to show a better way to do borders in a table. Note that you must set the cellpadding and cellspacing to 0 for this to work. Your CSS code can add the padding back in.

Code:
.table {
   border-top: 1px solid black;
   border-left: 1px solid black;
}

.table td {
   border-bottom: 1px solid black;
   border-right: 1px solid black;
   text-align: center;
   padding: 3px;
}
HTML Code:
<table border="0" cellspacing="0" cellpadding="0" class="table">
<tr>
   <td width="150px">Sample One</td>
   <td width="250px">Sample Two</td>
   <td width="75px">Sample Three</td>
</tr>
<tr>
   <td width="150px">Sample One</td>
   <td width="250px">Sample Two</td>
   <td width="75px">Sample Three</td>
</tr>
</table>
__________________
Hysterical Web Design

Please login or register to view this content. Registration is FREE

Fair priced and reliable web design services that complement your website needs
portkey is offline
Reply With Quote
View Public Profile Visit portkey's homepage!
 
Old 09-04-2009, 03:35 PM Re: using divs instead of a table for tabular data?
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Quote:
Tables I think use less code
Oh that is SO not true! Tables and nested tables for layout are a NIGHTMARE and BLOAT a page considerably.

Tables are also a nightmare when it comes to updating and redesigning a site - I could change an entire site by changing ONE file - the CSS file. Lets see you do THAT with tables (hint -- you can't!).
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to using divs instead of a table for tabular data?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.83705 seconds with 12 queries