Started studying HTML , but having a bit of a problem creating <table>s.
My instruction is to :"format the row in the table so that they alternate from white to grey. Within the grey rows format the text to white, Withing the white rows, format the text to black.
I created a table for this in a previous exercise which I'll paste in the bottom. If I understand correctly, I need to use the table's <tr> element, but I don't know how it should be formatted. Any suggestions would be greatly appreciated.
Here is what I got so far;
<form action="" name="newsHeadlines">
<table border="0" width="100%">
<tr valign="top">
<td>
<select name="headline" multiple="multiple" style="height: 93px">
<option onclick="document.newsHeadlines.news.value=newsItem1">
Investigation of building standards in quake zone
</option>
<option onclick="document.newsHeadlines.news.value=newsItem2">
Obama sees signs of economic progress
</option>
<option onclick="document.newsHeadlines.news.value=newsItem3">
Apple aplication downloads approach 1 Billion
</option>
What is the purpose of the multiple <select> element?
You are not using, nor is the syntax correct for
Quote:
/* <![CDATA[ */
/8 ]]> */
Finally, you should enclose your script between [ code] and [/ code] tags (without the spaces)
to make it easier to spot, copy, review or test your code.
If you are supposed to be using classes and attaching them to the table using JavaScript then take a look at http://javascriptexample.net/domtable11.php - you only need to attach a class to the alternate rows as you can let half the rows pick up the default styling of the table.