last day (15 days later) » 

13:21
19
Q: Produce a m*n table in HTML

potatoInput : Two decimal integers m and n that respectively give the number of rows and columns of the table. m and n are greater than or equal to 1. Output : A table in HTML that has m rows and n columns. The table should be displayable by a modern browser of your choice. Most browsers will displ...

Hi potato, and welcome to PPCG! This looks like an interesting challenge, but in the future, we recommend running challenges through the Sandbox before posting them here in order to clean up the details.
As a rule of thumb, you should avoid optional rules in a code-golf challenge, as they're going to be simply discarded by everyone.
It would be a good idea to allow any form of input, not just 2 integers separated by a space.
@JonathanAllan it is not possible, sadly the only utilities/websites I know that would allow that either rely on the browser used or aren't free services. I removed that condition following the general trend in the comments.
@Arnauld Indeed the <th> are required, the challenge gets too easy otherwise. The characters don't need to be distinct, it's just a visual marker as without CSS the table would just show as a blank space. I am not aware of a programming language designed to generate HTML but there surely are and I didn't want to prohibit using the closing tags.
If you want to get technical, the row with th elements should be in a thead and the body of the table should be in a tbody ;) There's also a tfoot!
13:21
Can we assume there is at least one row?
@Poke Technically, th elements do not need to be in a thead. They can also be used as the leftmost column in each row in the tbody or anywhere that you might expect a non-datavalue cell. I.E. <tr> <th>Name:</th> <td>(me)</td> <th>Spouse:</th> <td>(my wife)</td> </tr>
That said, the bottom line of code in the question is not valid HTML. The </table> end tag is not optional like the </tr> and </td> end tags.
@Poke the validity of the code produced is not relevant, as long as it is displayed as intended by modern browsers. On my machine, both Firefox and Safari show the same tables with the second version provided.
@MrLister the validity of the code is not part of the challenge, as long as the produced code is displayed by a modern browser (which are much more permissive than the HTML standard).
@wastl that seems fair enough, added to the challenge.
@potato But if it does not need to be a valid table, the resulting display can also be produced by not using table tags at all.
@MrLister yes but in the first case it's an invalid table and in the second it's not a table at all.
Just as a reference, HTML5 has a well defined algorithm to parse broken source (like missing closing tags), and such the tables are generated correctly. html.spec.whatwg.org/multipage/parsing.html#parse-errors
13:21
Yeah I'm aware that those tags aren't needed for a browser to properly format a table. Just wanted to add a juicy tidbit for the folks worried about that part.
I believe that you are missing the <th> in your example.

last day (15 days later) »