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

How can a user change the style that is viewed?

Status
Not open for further replies.

eyorre

Programmer
Jan 24, 2002
32
GB
My aim is to produce some buttons that when clicked on change the style in which the page is displayed. For instance I have a table with id's in the <td>'s:

<table>
<tr>
<td id=&quot;one&quot;>aaaa</td>
<td id=&quot;two&quot;>bbbb</td>
<td id=&quot;three&quot;>cccc</td>
<td id=&quot;four&quot;>dddd</td>
</tr>
</table>

I also have a stylesheet that refers to these ids eg

<style>
#one{visibility:hidden};
#two{visibility:hidden};
#three{visibility:hidden};
#four{visibility:hidden}
</style>

There are then 4 buttons to give the user a choice of what table cells to display. So for example if the user clicks on button 1 the style #one becomes #one{visibility:visible}. I have looked at having the styles in <style> tags within the page and also as a selection of 4 CSS documents with the appropriate CSS being brought up according the button clicked. I have not been successful with either method though as I am having trouble working out how to change the style or stylesheet when the button is clicked.

If anyone has any ideas how to do this it would be appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top