Raised This Month: $ Target: $400
 0% 

Solved Broken table when supposed to work


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 09-28-2021 , 20:48   Re: Broken table when supposed to work
Reply With Quote #3

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.
__________________

Last edited by fysiks; 09-28-2021 at 20:52.
fysiks is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 20:26.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode