vForums Support > Programming & Coding :: Code Requests & Support :: > Table background

Table background - Posted By Troy (troy) on 1st Jun 08 at 9:03pm
I put a table in my header, under the title, to tell the story in the board and I changed the text colour but I was wondering how could I change the background colour to black?

Re: Table background - Posted By Michael (wrighty) on 1st Jun 08 at 9:04pm
in the tag:
'<td ... >'

add this:

style = 'background-color: #000000;'

{Smile}

Re: Table background - Posted By Troy (troy) on 1st Jun 08 at 9:07pm
cool thank you

Re: Table background - Posted By Troy (troy) on 1st Jun 08 at 9:17pm
I did it but the table didn't go black, the spacing in between the categories did though

Re: Table background - Posted By Michael (wrighty) on 1st Jun 08 at 9:31pm
Can I have a forum link? And do you want the whole table to change, or just the cell? {Smile}

Re: Table background - Posted By Troy (troy) on 1st Jun 08 at 9:47pm
http://xhsmroleplayx.vforums.co.uk/

I don't know just the back ground of the table lol - sorry

Re: Table background - Posted By Michael (wrighty) on 1st Jun 08 at 9:48pm
Where the text is red? You want just behind that part to be black? {Unsure}

Re: Table background - Posted By Nick (nickb) on 1st Jun 08 at 11:59pm
Try this:
Code:
 
  1. <table border="0" cellpadding="3" cellspacing="1" class="border" width="100%" body bgcolor="#000000">
  2. <tr>
  3. <td class="title2" style="text-align:center;color:#6DC4E3;">Welcome to East High...
  4. </td></tr>
  5. <td class="window1">
  6.  
  7. <font color='#FF0000'><center>...Where the drama club is loved and the Wildcats rule. We come to the beginning of senior year (year 11), just after Troy met Gabriella at the ski resort. Everything may seem normal, at the moment, but soon enough things would change like no one could ever imagine, before anyone could control it, the status quo would be, in a way, thrown out the window.<br>
  8. <br>
  9. Miss Darbus is getting ready for the Twinkle Town musicale, the Wildcats are getting ready for their basketball finals, against West High Knights, and the decathlon team are getting ready for their day, but everything won't go as smooth as every one thinks.
  10. <center></font>
  11. </tr></table>
  12.  
 


Were it shows <table border="0" cellpadding="3" cellspacing="1" class="border" width="100%" body bgcolor="#000000"> It will make the whole table black. If that is what you want.

Re: Table background - Posted By Marc (cr0w) on 2nd Jun 08 at 12:15am
 
Try this:
Code:
 
  1. <table border="0" cellpadding="3" cellspacing="1" class="border" width="100%" body bgcolor="#000000">
  2. <tr>
  3. <td class="title2" style="text-align:center;color:#6DC4E3;">Welcome to East High...
  4. </td></tr>
  5. <td class="window1">
  6.  
  7. <font color='#FF0000'><center>...Where the drama club is loved and the Wildcats rule. We come to the beginning of senior year (year 11), just after Troy met Gabriella at the ski resort. Everything may seem normal, at the moment, but soon enough things would change like no one could ever imagine, before anyone could control it, the status quo would be, in a way, thrown out the window.<br>
  8. <br>
  9. Miss Darbus is getting ready for the Twinkle Town musicale, the Wildcats are getting ready for their basketball finals, against West High Knights, and the decathlon team are getting ready for their day, but everything won't go as smooth as every one thinks.
  10. <center></font>
  11. </tr></table>
  12.  
 


Were it shows <table border="0" cellpadding="3" cellspacing="1" class="border" width="100%" body bgcolor="#000000"> It will make the whole table black. If that is what you want.


There is no "body bgcolor" attribute to any tag; "body" is a tag in itself that denotes the start of the page's main content. That has nothing to do with the table. {Tongue Out}

Re: Table background - Posted By Nick (nickb) on 2nd Jun 08 at 12:16am
{Tongue Out} well it works.

EDIT:

it makes this work:

Code:
 
  1. <center>
  2. <table border="2" cellpadding="2" cellspacing="1" bgcolor=black >
  3. <tr>
  4. <td>
  5. <b>Staff</b>
  6. </td>
  7. <td>
  8. <b>Color</b>
  9. </td>
  10. </tr>
  11. <tr>
  12. <td>
  13. Founder/Admin
  14. </td>
  15. <td>
  16. <font color=white>White</color>
  17. </td>
  18. </tr>
  19. <tr>
  20. <td>
  21. Admin
  22. </td>
  23. <td>
  24. <font color=Gray>Gray</color>
  25. </td>
  26. </tr>
  27. <tr>
  28. <td>
  29. Global Moderator
  30. </td>
  31. <td>
  32. <font color=Green>Green</color>
  33. </td>
  34. </tr>
  35. <tr>
  36. <td>
  37. Moderator
  38. </td>
  39. <td>
  40. <font color=Blue>Blue</color>
  41. </td>
  42. </tr>
  43. </table>
  44. </center>
  45. </div>
  46. </td>
  47. </tr>
  48. </table>
  49. </div>
  50. </td>
  51. </tr>
  52. </table></center>
  53.  
  54.  
 

Re: Table background - Posted By Marc (cr0w) on 2nd Jun 08 at 12:17am
 
{Tongue Out} well it works.


It's also improper coding, would return errors in any code validation check and wouldn't work in older browsers. {Wink}

The motto I've always based my coding on: "Just because it works doesn't mean it's right" {Wink}

Re: Table background - Posted By Nick (nickb) on 2nd Jun 08 at 12:21am
ahh but you see it works in IE and FF, not sure about the rest like safari, or whatever other browsers are out there {Tongue Out}

Re: Table background - Posted By Marc (cr0w) on 2nd Jun 08 at 12:31am
I'll bet you're using the most recent versions, which not everybody is. {Wink}

While yes, it does work, it just doesn't make sense in the coding world. The body tag is a tag used solely for indicating the start of a page's content [as I said before]. It just doesn't belong within another tag, as that would make it an attribute rather than an element.

Re: Table background - Posted By Nick (nickb) on 2nd Jun 08 at 12:39am
 
I'll bet you're using the most recent versions, which not everybody is. {Wink}

While yes, it does work, it just doesn't make sense in the coding world. The body tag is a tag used solely for indicating the start of a page's content [as I said before]. It just doesn't belong within another tag, as that would make it an attribute rather than an element.


New version? FF? I use FF2.

and big words, can you rephrase what you said please. {Unsure}