Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

The below code works in NS4, NS6 an

Status
Not open for further replies.

viperedge

Programmer
Nov 26, 2002
4
0
0
US
The below code works in NS4, NS6 and IE 5+ , but once I use style sheets instead of the HTML attributes it all goes down the toilet. The borders have to print, thus the major issue with these so that they look good on a monitor and look good when printing.

Anyone have any ideas?

- Thanks Dave


<table width=&quot;211&quot; border=&quot;1&quot; cellspacing=&quot;0&quot; cellpadding=&quot;5&quot; bordercolor=&quot;#cccc99&quot;>
<tr bordercolor=&quot;#cccc99&quot;>
<td colspan=&quot;2&quot; bgcolor=&quot;#cccc99&quot; >
Account Status
</td>

</tr>
<tr bordercolor=&quot;#cccc99&quot;>
<td >
Text Text Text Text
</td>
<td >
Text Text Text Text
</td>
</tr>
</table>
 
Why do you have to change it than?

if it's working this way, why not keep it this way?

M...
 
For the large site, it will have different colors and such and will be used across 2 sites in the future to keep the same look. Thus Style sheets would be very nice to have for easy changes across the board. On some pages this will be used 10+ times, on some 20-30 pages off the top of my head and possibly more. Will save me from having to do a search and replace each time my great designers/bosses change a color or font like they do daily.

- Dave
 
I may be out of line but I wonder why you're trying to specify the border colors of your table rows and cells when you're already doing it in your table definition.

When you specify a border color in your table definition, you're setting the cell borders for the entire table. If you need different cell border colors, you might try nesting tables and specifying border colors there. There's always a better way...
 
Like this:

<table width=&quot;211&quot; border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; >
<tr>
<td colspan=&quot;2&quot; bgcolor=&quot;#cccc99&quot; >
<table width=&quot;211&quot; border=&quot;1&quot; cellspacing=&quot;0&quot; cellpadding=&quot;5&quot; bordercolor=&quot;#cccc99&quot;>
<tr bordercolor=&quot;#cccc99&quot;><td >Account Status</td> </tr>
</table>
</td>
</tr>
<tr>
<td>
<table width=&quot;211&quot; border=&quot;1&quot; cellspacing=&quot;0&quot; cellpadding=&quot;5&quot; bordercolor=&quot;#cccc99&quot;>
<tr ><td bordercolor=&quot;#cccc99&quot;>Text Text Text Text</td> </tr>
</table>
</td>
<td>
<table width=&quot;211&quot; border=&quot;1&quot; cellspacing=&quot;0&quot; cellpadding=&quot;5&quot; bordercolor=&quot;#cccc99&quot;>
<tr ><td bordercolor=&quot;#cccc99&quot;>Text Text Text Text</td> </tr>
</table>
</td>
</tr>
</table>


Open it in Dreamweaver or CF Studio and you get a double wide border between the cells and a thin outer border. Thus it will be rejected, thanks for the idea tho.


- Dave
 
So, if I got you right, you want to keep the same style for all table elements (when printed), regardless their actual settings in html?

There's a way to do it:

@media print {
td { background-color: #eeeeee; font-face: arial; padding: 0 10px 0 10px }
td.head { background-color: #cccccc; font: bold 12pt arial,sans-serif; color: white }
td.one { font: 10pt times,serif }
}

Assign the necessary style classes on all your pages.

Read more about @media here:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top