Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Dec 16th, 2005, 2:41 PM   #1
Sane
Banned
 
Sane's Avatar
 
Join Date: Apr 2005
Location: Waterloo, Ontario
Posts: 2,101
Rep Power: 6 Sane will become famous soon enough
Send a message via MSN to Sane
Automatic Table Templates?

I'm assuming this is CSS. How would I add something to the top of an html file to make it so any table I make automatically has a certain design/properties to it?
Sane is offline   Reply With Quote
Old Dec 16th, 2005, 2:51 PM   #2
Agent 47
Hobbyist Programmer
 
Agent 47's Avatar
 
Join Date: Nov 2005
Posts: 122
Rep Power: 4 Agent 47 is on a distinguished road
What are you using the tables for?
<style type="text/css">
table
{
   width:100px;
   ...
}
</style>
Put that in the <head>.
__________________
"I'm going to become rich and famous when I invent a device that allows you to stab people in the face over the internet"
Agent 47 is offline   Reply With Quote
Old Dec 16th, 2005, 8:06 PM   #3
Sane
Banned
 
Sane's Avatar
 
Join Date: Apr 2005
Location: Waterloo, Ontario
Posts: 2,101
Rep Power: 6 Sane will become famous soon enough
Send a message via MSN to Sane
I'm using it for a statistic display site.

It seems to work well. What are some other paramaters I can use in there?
Sane is offline   Reply With Quote
Old Dec 16th, 2005, 10:50 PM   #4
Agent 47
Hobbyist Programmer
 
Agent 47's Avatar
 
Join Date: Nov 2005
Posts: 122
Rep Power: 4 Agent 47 is on a distinguished road
Pretty much anything. Or don't you know any CSS?
__________________
"I'm going to become rich and famous when I invent a device that allows you to stab people in the face over the internet"
Agent 47 is offline   Reply With Quote
Old Dec 16th, 2005, 10:59 PM   #5
Dameon
Troll
 
Dameon's Avatar
 
Join Date: Apr 2005
Location: Texas
Posts: 732
Rep Power: 4 Dameon is on a distinguished road
W3Schools helped me out a lot for initial learning. The reference isn't bad, but doesn't go into enough detail.

http://www.w3schools.com/css/
__________________
MD5(sig) = bcef75433db02e9ad9bf81d6f7c5c270
Dameon is offline   Reply With Quote
Old Dec 17th, 2005, 2:45 AM   #6
coldDeath
Expert Programmer
 
coldDeath's Avatar
 
Join Date: Aug 2005
Location: UK
Posts: 862
Rep Power: 4 coldDeath is on a distinguished road
Send a message via AIM to coldDeath Send a message via Yahoo to coldDeath
http://www.w3schools.com/css/css_reference.asp <--- a reference
__________________
Join us at #programmingforums @ irc.freenode.net!

My software never has bugs. It just develops random features.
coldDeath is offline   Reply With Quote
Old Dec 17th, 2005, 12:09 PM   #7
Sane
Banned
 
Sane's Avatar
 
Join Date: Apr 2005
Location: Waterloo, Ontario
Posts: 2,101
Rep Power: 6 Sane will become famous soon enough
Send a message via MSN to Sane
I know absolutely no CSS or any website language for that matter (except HTML forms and simple output). Thanks for the reference links.
Sane is offline   Reply With Quote
Old Dec 17th, 2005, 1:56 PM   #8
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Indeed, Google is your friend, but rarely visits uninvited.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Dec 17th, 2005, 2:18 PM   #9
titaniumdecoy
Expert Programmer
 
titaniumdecoy's Avatar
 
Join Date: Nov 2005
Posts: 936
Rep Power: 4 titaniumdecoy is on a distinguished road
Send a message via AIM to titaniumdecoy
For cell padding, you can use:
td {
    padding: Xpx;
    border: inset Xpx;
}
For spacing between cells, you can use:
table {
    border-collapse: separate;
    border-spacing: 10px;
    border: outset Xpx;
}
The border: properties are optional but will help achieve a more table-like look. Remember to replace Xpx with a number, for example 2px.

Another way to do this, if you want the space between cells to have a color:
table {
    border-collapse: collapse;
}
td {
    border: solid 5px yellow;
}
This will create a table with yellow lines between the cells.

Also, remember that the cellspacing and cellpadding table attributes are not deprecated even in XHTML 1.1.

You'll find this page very useful. It has everything you'll ever want to know about tables and CSS.
titaniumdecoy is online now   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

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

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
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 11:37 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC