|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Css For Tables
GREETINGS: In creating a "TABLE" in a WebPage, using HTML code I have been doing a TON of typing in each cell..designating the font size, color, alignment, etc.
Now, however,I have discovered that using the following CSS code: <.style type="text/css".> <.!-- TD { color : Blue; font-size : smaller; font-weight : bold; text-align : center; } --.> <./style.> (Without the periods), this will eliminate the need for all my typing, other than any special text I may want to place in the cell, SUCH AS NAMES, DESCRIPTION, ETC. ************************************ This is a great advancement for me, as long as the TABLE or TABLES "ALL" have the same font, color, size and format. ************************************* HOWEVER, does anyone know how or where I can alter or place CSS code to permit me to have additional TABLES having different colors, font sizes, etc., etc. MITCH MENSCHEL/WEBMASTER |
|
#2
|
||||
|
||||
|
Hy Cyber-Gramps, welcome to these forums!
Yes, CSS is a wonderfull thing ![]() Check the specs on W3.org to see/learn what's possible... in your case though, using classes (names) should do: Code:
<html>
<head>
<style>
td.name1 {
color: blue;
}
td.name2 {
color: red;
}
</style>
</head>
<body>
<table>
<tr>
<td class=name1>This is a blue text</td>
<td class=name2>This should be a red text</td>
</tr>
</table>
</body>
</html>
![]()
__________________
There are 10 types of people in this world - those who understand binary and those who don't... PHP | MySQL | DevShed Forum Search | Google Search |
|
#3
|
|||
|
|||
|
or put table instead of td to have the table have those properties. rather than mark each cell.
|
|
#4
|
|||
|
|||
|
HI! Thank you for responding to my S.O.S.
The problem I have is to UNDERSTAND "WHERE AND HOW" I am to place your suggested CSS codes. At this time, I still need "step-by-step" directions in order to have it work for me. I would greatly appreciate it if you would check out the short page I just published at: URL and give me the details that I need to know in order to make the second table have different size font and different color. Thanks, once again, for your cooperation. MITCH MENSCHEL |
|
#5
|
||||
|
||||
|
Here is an example for you. I took the code from your page and changed it around a little and put two seperate classes and assigned them to the table rows and made it just one table.
Code:
<html>
<head>
<style type="text/css">
<!--
.mitch {
color : Blue;
font-size : smaller;
font-weight : bold;
text-align : center;
font-family : Sans-Serif, Helvetica, Arial;
}
.angela {
color : Red;
font-size : small;
font-weight : 500;
text-align : center;
font-family : Arial, Helvetica, Sans-Serif;
}
-->
</style>
<title>USING CSS CODE IN TABLE</title>
</head>
<body BGCOLOR="AQUA">
<table id="blueTable" align="center">
<tr class="mitch">
<td>
<img SRC="mitch_hd.jpg"><br>Mitch
</td>
<td>
</td>
<td>
<img SRC="mitch_hd.jpg"><br>Mitch8888
</td>
<td>
</td>
<td>
<img SRC="mitch_hd.jpg"><br>Mitch-7
</td>
<td>
</td>
<td>
<img SRC="mitch_hd.jpg"><br>Mitch5
</td>
</tr>
<tr>
<td colspan="4">
</td>
</tr>
<tr class="angela">
<td>
<img SRC="angela-opt.jpg" WIDTH=100><br>Angela Aschrennner
</td>
<td>
</td>
<td>
<img SRC="angela-opt.jpg" WIDTH=100><br>Angela-Director
</td>
<td>
</td>
<td>
<img SRC="angela-opt.jpg" WIDTH=100><br>Angela-CRTA
</td>
<td>
</td>
<td>
<img SRC="angela-opt.jpg" WIDTH=100><br>AREA-11-CRTA
</td>
</tr>
</table>
</body>
</html>
|
|
#6
|
|||
|
|||
|
CSS CODE FOR PLACEMENT/COLORS,ETC.
HI! Well, I must say that I am amazed at the immediate response that I have been receiving, relative to my question on CSS.
All the answers to my problem were probably all good and correct, but the very last one, that I am now responding to, actually showed me the EXAMPLE THAT I NEEDED.... really "STEP-BY-STEP".....and now I know how to apply the changes needed. This puts me on the path for bigger and better webpage creation, for I have been creating and publishing webpages for Non-Profit groups in San Diego, CA. I cannot express my sincere THANKS often enough..... THANKS, AGAIN....TO ALL. You all made an old geezer of 84 very happy, showing him the way..... MITCH MENSCHEL/WEBMASTER aka "CYBER-GRAMPS" |
![]() |
| Viewing: Dev Shed Forums > Web Design > CSS Help > Css For Tables |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|