WordPress dropping alternating HTML table rows when bgcolor is used
-
Hi,
I have a table — 3 columns and 7 rows. First row is the header. I’m coding raw, simple html in the html tab. Nothing generated by Word etc. I want to have colored banding on alternating rows. i.e. Rows 1, 3, 5 and 7 all have a light blue background. Rows 2,4,6 have a white background (i.e. no bgcolor element)
My table looks fine something like:
<table>
<tr>
row 1 contents
</tr>
<tr>
row 2 contents
</tr>
…
<tr>
row 7 contents
</tr>
</table>When I put a bgcolor in the <tr> tag of rows 1, 3, 5, 7 and save, the html of rows 3,5, and 7 disappears and I’ve only got 4 rows in my table. This has happened to me twice. It makes no sense.
My blog is onproductmanagement.wordpress.com.
I have not published the posting with this.
-
Perhaps you are coding it wrong. For one thing, TR elements do not have a bgcolor attribute. Second, you aren’t showing TD elements. Here’s an example of alternating colors:
<table> <tr> <td bgcolor="#C0C0FF">Row 1</td> </tr><tr> <td bgcolor="#FFFFFF">Row 2</td> </tr><tr> <td bgcolor="#C0C0FF">Row 3</td> </tr><tr> <td bgcolor="#FFFFFF">Row 4</td> </tr><tr> <td bgcolor="#C0C0FF">Row 5</td> </tr> </table> -
Hi,
I’ll double check the html….but I had something weird happen after I posted this support issue. I saved the blog posting with my manually created table and then previewed the page. It looked fine. Without closing that tab in Firefox, I went back to the tab where I was editing the posting, and saw that the rows had disappeared.
I then went back to the tab with the preview of the posting and viewed the source. I took the HTML for the table (from <table> to </table>) from the view source window and pasted it into the blog posting.
I then saved the posting. At this point I figured, any of my html coding mistakes would be eliminated. Lo and behold the rows had disappeared again!
Can’t figure it out.
-
BTW, I did have TD elements in my table html, but didn’t include them in my original posting above for brevity. Thanks for the quick response.
-
Tables have, in my experience, simply always failed at WP.com unless they’re saved as an image and the image itself is what’s uploaded. There are several threads that a forum search will reveal, but no solutions as far as I know.
-
I haven’t had any problems posting my quiz results as entries, and they use tables.
If you have the Visual editor enabled, try disabling it. I have it disabled due to incompatibilities with my browser (Opera 9), and have found that it doesn’t change around my manual HTML as much as it did before I disabled it.
- The topic ‘WordPress dropping alternating HTML table rows when bgcolor is used’ is closed to new replies.