Announcement

Collapse
No announcement yet.

Coloring a cell in a table adding messes up formatting?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Coloring a cell in a table adding messes up formatting?

    Having this problem on my forum when I turn on html, here's a screenshot while I have the editor open:

    Click image for larger version

Name:	2018-01-09 00_31_58.png
Views:	9
Size:	3.6 KB
ID:	4384441
    I'm not great at html but I would assume this should make 2 columns, 3 rows, one cell red, one green.
    Instead this is the result when I hit save:
    Click image for larger version

Name:	2018-01-09 00_32_39.png
Views:	3
Size:	1.7 KB
ID:	4384442

    I have seen this happen several times when trying to use colored cells in a table. There's every chance in the world I just don't know what I'm doing but if that is the case I'm not sure what it would be since it seems relatively straightforward. Help? VB 5.3.3

  • #2
    This is working fine. You have to edit it in source-code-view.

    HTML Code:
    <table> <tr>
    <th style="background-color:green">Berlin</th> <th>Hamburg</th> <th>München</th> </tr> <tr> <td>Miljöh</td> <td>Kiez</td> <td>Bierdampf</td> </tr> <tr> <td>Buletten</td> <td>Frikadellen</td> <td>Fleischpflanzerl</td> </tr> </table>
    vBulletin-Forum.de closed!

    Comment


    • #3
      When you use table HTML, you need to tell the system not to convert the linebreaks. If you don't then they will be converted to <br> tags and that will create havoc with things.

      The option is under "Advanced Options" in the editor.
      Click image for larger version

Name:	Screenshot_21.png
Views:	4
Size:	14.5 KB
ID:	4384479



      Or put all of your HTML on a single line like the post above.
      Translations provided by Google.

      Wayne Luke
      The Rabid Badger - a vBulletin Cloud customization and demonstration site.
      vBulletin 5 Documentation - Updated every Friday. Report issues here.
      vBulletin 5 API - Full / Mobile
      I am not currently available for vB Messenger Chats.

      Comment


      • #4
        Even when I am not converting linebreaks I still can't get it to work. See linked gif.
        https://media.giphy.com/media/3ohc0Z...7Afm/giphy.gif

        Also when using the same method on a separate thread I get different results. Below Is also a table, 2x2, it does not make an additional column regardless of whether it is converting linebreaks.
        However it does add this weird spacing to the left instead, i.e. it does not fill the entire table with color.

        https://media.giphy.com/media/xULW8l...YVvW/giphy.gif
        Last edited by tracks78; Thu 11th Jan '18, 12:35am.

        Comment


        • #5
          Do not use the Advance Editor when you edit HTML! You have to edit the code!
          Click image for larger version  Name:	AdvModus.jpg Views:	1 Size:	17.7 KB ID:	4384575
          vBulletin-Forum.de closed!

          Comment


          • #6
            Ok thanks guys, figured it out. Thought I could use the editor to make the initial tables and just add to it by pasting in something to change the color of the cell like

            <td bgcolor="#00FF00">test</td> or <td style="background-color:red">test2</td>

            But when the editor makes a table it's not based off of HTML, <table> vs [TABLE]. And turning on HTML does not convert existing tables into html tables. So pasting html into the existing table just messes it up regardless of using the editor, editing the code, or converting linebreaks.

            Comment

            widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
            Working...
            X