1

I am trying to color the cells of a table in Azure DevOps Wiki Table I have this in my markdown

|Tag|Requied/Optional  |Notes  |Examples  |
|--|--|--|--|
| <td style="background-color:green;color:white;">1</td> | <td style="background-color:green;color:white;">2</td> | <td style="background-color:green;color:white;">3</td> | <td style="background-color:green;color:white;">4</td> |
|  |  |  |  |
|  |  |  |  |

but it comes out looking like this enter image description here

Im trying to figure out why/where the extra cells in between are coming from and how to get rid of them.

SteveAnselment
  • 634
  • 3
  • 10
  • 29

2 Answers2

1

You can try it with inline styling

<table style="border:ridge 4px red">
  <tr style="background-color:blue;color:white;" id="ROW1">
    <td style="border:ridge 4px red" >Cell 1.1</td>
    <td style="border:ridge 4px red">Cell 1.2</td>
    <td style="border:ridge 4px red">Cell 1.3</td>
  </tr>
  <tr style="background-color:yellow;color:green;" id="ROW2">
    <td style="border:ridge 4px red">Cell 2.1</td>
    <td style="border:ridge 4px red">Cell 2.2</td>
    <td style="border:ridge 4px red">Cell 2.3</td>
  </tr>
</table>

Also please refer this SO thread How to apply color in Markdown for more information.

  • While this technically works, this doesn't answer my question... I don't really want to rebuild the table with HTML... It works in Markdown, just adds extra fields for some reason. Those extra fields are what I want to dispose of. – SteveAnselment Feb 09 '22 at 15:39
0

You are duplicating the table information within the Markdown table syntax, instead you need to just apply the colour information via span.

Due to this I haven't found a way of fully colouring the cell background, just the text...

|Tag|Required/Optional  |Notes  |Examples  |
|--|--|--|--|
| <span style="background-color:green;color:white;">1</span> | <span style="background-color:green;color:white;">2</span> | <span style="background-color:green;color:white;">3</span> | <span style="background-color:green;color:white;">4</span> |
|  |  |  |  |
|  |  |  |  |
Paul Hatcher
  • 7,342
  • 1
  • 54
  • 51