I manually created the HTML that you're generating with your code and it renders perfectly in the Counter-Strike motd.txt. It takes up the whole width of the MOTD window. I tried it both with and without all the newline characters and it looked perfect either way.
HTML Code:
<!DOCTYPE html><html>
<head><meta name='viewport' content='width=device-width, initial-scale=1'>
<meta http-equiv='X-UA-Compatible' content='IE=edge' />
<style>table { border-collapse: collapse; width: 100%; border: 1px solid #ddd; } th, td { text-align: left; padding: 16px; }</style></head>
<body><br><center><table><tr><th>Rank</th><th>Name</th><th>Kills</th><th>Deaths</th><th>Headshots</th></tr>
<tr><td>1
<td>NameNameNameNameName!!
<td>10
<td>12
<td>14
<tr><td>2
<td>NameNameNameNameName!!
<td>10
<td>12
<td>14
<tr><td>3
<td>NameNameNameNameName!!
<td>10
<td>12
<td>14
<tr><td>4
<td>NameNameNameNameName!!
<td>10
<td>12
<td>14
<tr><td>5
<td>NameNameNameNameName!!
<td>10
<td>12
<td>14
<tr><td>6
<td>NameNameNameNameName!!
<td>10
<td>12
<td>14
<tr><td>7
<td>NameNameNameNameName!!
<td>10
<td>12
<td>14
<tr><td>8
<td>NameNameNameNameName!!
<td>10
<td>12
<td>14
<tr><td>9
<td>NameNameNameNameName!!
<td>10
<td>12
<td>14
<tr><td>10
<td>NameNameNameNameName!!
<td>10
<td>12
<td>14
<tr><td>11
<td>NameNameNameNameName!!
<td>10
<td>12
<td>14
<tr><td>12
<td>NameNameNameNameName!!
<td>10
<td>12
<td>14
<tr><td>13
<td>NameNameNameNameName!!
<td>10
<td>12
<td>14
<tr><td>14
<td>NameNameNameNameName!!
<td>10
<td>12
<td>14
<tr><td>15
<td>NameNameNameNameName!!
<td>10
<td>12
<td>14
</table></center></body></html>
Maybe try to print gMotd[] to a file so that you can verify and test the resulting HTML.
@Bugsy, it looks like it's able to properly render without all the closing tags as shown above. In fact, it looks like adding all the closing tags for tr and td will actually cause this to go over the 1536 character limit.
Also, note that the MOTD is limited to 1536 characters so you can declare gMotd[1537] instead of using 2048.
__________________