Jump to content

[SOLVED] Why isn't this working?


MsRedImp

Recommended Posts

I have a feeling this has something to do with where I placed the tags. For some reason this div tag isn't taking any effect on the text inside, if I change the color or size nothing happens. It may have something to do with the tables, but if I put it before the <td> and after the </td> it works, any help please?

 

<div style="color: #FFFFFF; font-size:5px">
  <tr bgcolor="#336699">
    <td><b>1st</b></td>
    <td><b>Matt Smith</b></td>
  </tr>
</div>

Link to comment
Share on other sites

Ah I understand what you mean. But if I put them inside the <td> tags I have to do the whole <div style> code for every row and column of text I want with that size and color, this is why I put it on the outside so that it can color and size many rows at once. Why isn't this working? I put a <div style> tag on the outside of the whole table form, so that all of the text inside is centered and a certain font, so why can't i put one inside? Here is the whole code:

 

// This div code works and affects the text.
<div style="position:absolute; LEFT:13px; top:90px; font-family:tahoma; text-align:center">
<table width="180" border="2" bordercolor="#004284" >
// This one doesn't do anything, but I want more than one row to be affected.
<div style="color: #FFFFFF; font-size:5px">
  <tr bgcolor="#336699">
   <td><b>1st</b></td>
   <td><b>Matt Smith</b></td>
  </tr>
</div>
  <tr>
  	<td>2nd</td>
  	<td>James Ford</td>
  </tr>
  <tr>
  	<td>3rd</td>
  	<td>Ashley Jones</td>
  </tr>
</table>
</div>

Link to comment
Share on other sites

I put a <div style> tag on the outside of the whole table form, so that all of the text inside is centered and a certain font, so why can't i put one inside?

Because it's invalid html. The only things you can put in-between table tags are tr, td, and th.

Remove the div and change the tr to this:

<tr style="background-color:#336699; color:#ffffff; font-size:5px">

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.