Applying style to entire table rather than individual cells

  • Thread starter Thread starter anon
  • Start date Start date
A

anon

Hi there.

I use tables on every webpage to display a list of links to news articles, their
source, an abstract for each etc.

I've been applying a style to each table row and obviously my code ends up with
many more entries than it should.

Is there a way to remove the style from the table rows and change it to apply to
the entire table? I mean, without going through every line individually? I've
got 240 pages to deal with and am looking for something that won't take days to
do.

I have never figured out how to use the scan option, so maybe that is the answer
and I should dig deeper before bugging you guys, but hey, you are here and you
want to help us novices, right???

Thanks in advance for your advice.
 
Hi Anon,

Give the table a class name then use CSS to reference the td element.

<style>
..myTable td { background-color: yellow; }
</style>

The above will make all cells of a Table with the class myTable have a yellow background.
 
Is there a way to remove the style from the table rows and change it to
apply to
the entire table?

Soitenly!

Show me an example of one of your styled row tags, please.
 
Wanna point me to a specific row there? I'm seeing lots of styled <td> tags
but no <tr> tags.
 
Wanna point me to a specific row there? I'm seeing lots of styled <td> tags
but no <tr> tags.

....now that you mention it, Murray....

I guess I've applied the style to every data cell, haven't I? So the problem is
even worse.

It seems to me that I'm going to have to go through the pages in html view, use
the find/replace feature to get rid of the style in each cell and then try to
figure out how to do a style span. Does that sound right?

Thank you for your help.
 
It could be as simple as searching for <td class="cellspan"> and replacing
it with <th> (of course, that's assuming you have created a special style
for <th> tags). But is that the right class to search for?
 
Tell me what style it is that you are wanting to replace, please.

Murray,

What I am trying to figure out is whether or not it is bad "form" to apply the
"cellspan" style to each data cell. It seemed to me that if I could simply
apply that style (which I defined on my stylesheet as "cellspan") to an entire
table or at least a *group* of rows, there would be cleaner html. I was trying
to figure out how to go about that. I'll keep cruising the net to see what is
proper and what might work. Thanks for your help, though.
 
Your class="cellspan" is only used for links
Create a custom pseudo link styles as say
a.cellspan
a.cellspan:visited
etc
and apply the styles to the links - not the cells

--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
_____________________________________________


| In article <[email protected]>, Murray says...
| >
| >Tell me what style it is that you are wanting to replace, please.
|
| Murray,
|
| What I am trying to figure out is whether or not it is bad "form" to apply the
| "cellspan" style to each data cell. It seemed to me that if I could simply
| apply that style (which I defined on my stylesheet as "cellspan") to an entire
| table or at least a *group* of rows, there would be cleaner html. I was trying
| to figure out how to go about that. I'll keep cruising the net to see what is
| proper and what might work. Thanks for your help, though.
|
 
No, I don't agree with this. Adding it directly to the <a> tag is
unnecessary since the page has a valid and complete doctype and since the
style will inherit into those links.

The 'cellspan' class is used for both basic formatting and link styles, so
just do this -

Remove the 'class="cellspan"' style from all of your cells. Leave it on the
<table> tag. The cellspan styles will inherit into the table's cells and
you'll be fine.

By the way, you'll want to fix this width specification here (it should be
'width="760"', or if you want to make it part of the inline styles, make it
like 'style="border-collapse:collapse;width:760px">' -

<table border="0" cellpadding="0" cellspacing="0" style="border-collapse:
collapse" width=760px>
 
Back
Top