469,290 Members | 1,820 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,290 developers. It's quick & easy.

Table behavior Old Way upgraded to CSS

I have a table that works nicely using a combo of old school HTML and
some CSS. I need to keep using tables (due to other code on the
serverside), but would love to get cellpadding, cellspacing and border
in the TABLE tag to be replaced with a single class, while keeping the
same overall behavior.

Here is the current code:

<table height="27" cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="table1_corner_top_left"><!-- Shape Holder --><img
src="../images/dot_blank.gif" width="8" height="23" alt=""></td>
<td class="table1_top_sliver" width="100%"
align="absmiddle">Stuff</td>
<td class="table1_top_sliver" rowspan="2"
align="absmiddle">Options</td>
<td class="table1_corner_top_right"><!-- Shape Holder --><img
src="../images/dot_blank.gif" width="7" height="23" alt=""></td>
</tr>
<tr>
<td class="table1_left_sliver"><!-- Shape Holder --><img
src="../images/dot_blank.gif" width="8" height="4" alt=""></td>
<td class="table1_main_bg_color"><img
src="../images/dot_blank.gif">a<br>b</td>
<td class="table1_right_sliver"><!-- Shape Holder --><img
src="../images/dot_blank.gif" width="7" height="4" alt=""></td>
</tr>
</table>

What class properties will keep this table behaving the same way?

I tried:

<table height="27" class="Main_Table">

where

..MAIN_TABLE
{
padding: 0;
border: 0;
border-collapse: collapse;
}

But I couldn't find a replacement for cellspacing, AND, the whole thing
started getting distorted (where I am using background images).

Is this an instance where I should stick with the Old School HTML way?

Thanks,
Ann

Feb 1 '06 #1
2 1239
Giggle Girl wrote:

I tried:

<table height="27" class="Main_Table">
where
.MAIN_TABLE
{
padding: 0;
border: 0;
border-collapse: collapse;
}
But I couldn't find a replacement for cellspacing, [...]

Use
.Main_Table td { padding: ...; margin: ...; }
to set the spacing for the cells.

--
jmm (hyphen) list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
Feb 1 '06 #2
Thank you so much, Jim Moe! :)

Ann

Feb 1 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by (Pete Cresswell) | last post: by
10 posts views Thread by Damien | last post: by
8 posts views Thread by PengYu.UT | last post: by
reply views Thread by Gareth Stretch | last post: by
1 post views Thread by paul reed | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.