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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XML style on multiple elements

Status
Not open for further replies.

Silvinho

Programmer
Jul 9, 2001
58
GB
Is it possible to apply an xml style to more than one element at a time.

basically i want to change the attibutes of the <TABLE> tag and the <TR> tag at the same time as below.

<Style name="Table Style" element="table">
<Attribute name="cellspacing" value="0" />
<Attribute name="cellpadding" value="1" />
<Attribute name="border" value="0" />
<Attribute name="bgcolor" value="#CCCCCC" />
</Style>

<Style name="Table Style 2" element="tr">
<Attribute name="bgcolor" value="#FFFFFF" />
</Style>

the application im using will only allow me to select the <table> tag and im completely stuck. Im new to xml so any help would be appreciated.
 
What are you trying to do? You definitely don't want to start storing styling information like this. Use a stylesheet.
 
I've got a style sheet but i haven't found a way to apply styles to the <TR> tags by only applying a style to the <table> tag.

Im using a text editor which you can attach xml styles to various elements when there clicked on, ie: images, <hr> etc...

the problem is you can only click on the <table>. you cant click the <tr> or <td> tags so you cant apply styles to them. I cant use a ccs style to change all <tr> tags as it would mess up other parts of the site.

 
Or put a class on your table:

<table class="myclass">

then use:

table.myclass tr
{
background-color: green;
}

and make your code standards compliant.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top