Can someone explain post formatting with HTML?

Some context:

I’m still in the early learning stage of HTML, so please bear with me here.

I notice that the composer will translate some HTML code, but it doesn’t want to recognize more detailed elements/ attributes.


For example, the composer will read a basic table like this:

<table>
 <tr>
  <th>Name</th>
  <th>Favorite Color</th>
 </tr>
 <tr>
  <td>Bob</td>
  <td>Yellow</td>
 </tr>
 <tr>
  <td>Michelle</td>
  <td>Purple</td>
 </tr>
</table>
Name Favorite Color
Bob Yellow
Michelle Purple

This appears to work just fine, just a straight forward table built with super basic elements.


But the composer doesn’t seem to want to read more specialized elements and attributes. For example, if I add some column styling under the opening <table> element:

<table>
  <colgroup>
    <col style="background-color: yellow" span="2">
  </colgroup>
 <tr>
  <th>Name</th>
  <th>Favorite Color</th>
 </tr>
 <tr>
  <td>Bob</td>
  <td>Yellow</td>
 </tr>
 <tr>
  <td>Michelle</td>
  <td>Purple</td>
 </tr>
</table>

The composer won’t translate it; it also won’t break anything:

Name Favorite Color
Bob Yellow
Michelle Purple

Now, one of the things I have run into during my head-first dive into coding, is that there is more than one way to skin a cat. It seems like every website will offer a different means to the same end.

I would appreciate any information that can help me to think better about this.

So, my questions:

  • Is this a problem with my approach/ current understanding of HTML?

  • Is the composer simply selective on what it will translate? And if so, are there clear parameters for this?

  • Is there a setting that can enable the composer to translate more complex HTML? And would enabling this be a bad idea?

Thank you

2 Likes

Raw HTML would cause many security exploits (in posts). Only a very tightly whitelisted subset of tags and elements are allowed.

In general you should not be using HTML, use Markdown, per commonmark.org/help

Now for Admin, Customize areas where HTML is allowed as part of site setup and customization, admins can indeed put in whatever HTML they want.

3 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.