Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Community Discussions (All other subjects)
 conversion to CSS
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

MarcelG
Retired Support Moderator

Netherlands
2625 Posts

Posted - 17 June 2005 :  05:56:20  Show Profile  Visit MarcelG's Homepage
I'm trying to convert my site to use some more CSS styles, and I've already created a replacement for some recurring font tags.
Now I'm trying to convert some of the tables to CSS styles.

For example, I've got this table opening;
<table align=""center"" cellspacing=""1"" cellpadding=""1"" border=""0"" bgcolor=""" & strTableBorderColor & """ width=""10%"">

How would I convert this to this:
<table class=""ts01"">
(ts01 = table style 01)
I've tried it with this:
".ts01{text-align: center; spacing: 1; padding: 1; border: none; background: " & strTableBorderColor & "}" & vbNewline & _
but that gives me strange results (the padding/spacing seems more than it should be.

By the way, the total table I'm trying to CSS is a sort of 'default' table used in my sidebar.
It's allways constructed like this:
Response.Write "<table align=""center"" cellspacing=""1"" cellpadding=""1"" border=""0"" bgcolor=""" & strTableBorderColor & """ width=""10%"">" & vbNewLine & _  
"  <tr>" & vbNewLine & _ 
"  <td bgcolor=""" & strCategoryCellColor & """ height=""" & strCategoryCellHeight & """>" & vbNewLine & _ 
"  <font class=""fft0""><b> " & strSidebarDelimiter & strAdText & strSidebarDelimiter & "</b></font></td>" & vbNewLine & _ 
"  </tr><td cellspacing=""0"" bgcolor=""" & strForumCellColor & """ align=""center"" valign=""middle"">" & vbNewLine & _  
"  <table align=""center"" cellspacing=""0"" cellpadding=""0"" border=""0"" bgcolor=""" & strForumCellColor & """ width=""10%"">" & vbNewLine & _  
"  <tr height=""2"">" & vbNewLine & _  
"  <td bgcolor=""" & strForumCellColor & """ align=""center"" valign=""middle"" height=""2"">" 
%>
<!--#INCLUDE file="inc_adsense.asp" -->
<%
Response.Write "</td></td></table></tr></table>"

In green the first surrounding table, in brown the second inner table.

portfolio - linkshrinker - oxle - twitter

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 17 June 2005 :  06:29:24  Show Profile
Your table tag would need to look like this:
<table class=""ts01"" cellspacing=""1"" cellpadding=""1"">
And your CSS would then be:
.ts01{width:10%;margin:auto;background:"&strTableBorderColor&";border:0;
As far as I know there are no CSS replacements for cellpadding and cellspacing as yet but you may want to double check that. Also, I'm not certain that auto margins will work with realtive widths in all browsers.


Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page

MarcelG
Retired Support Moderator

Netherlands
2625 Posts

Posted - 17 June 2005 :  07:32:52  Show Profile  Visit MarcelG's Homepage
thanks!!!! Going to try it out right away!

portfolio - linkshrinker - oxle - twitter
Go to Top of Page

Ranko
Junior Member

400 Posts

Posted - 22 June 2005 :  04:34:57  Show Profile
If using divs for layout, you can use margin for cellspacing, and padding for cellpadding. Used carefully (some thought and knowledge requiered) you won't have any problems.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.42 seconds. Powered By: Snitz Forums 2000 Version 3.4.07