Let's say we want to make a tic-tac-toe game. Is in possible with three TRs, each with only one TD containing three INPUTs? Or does each TR require three TDs, each TD containing one INPUT?
-
your question doesn't make sense. You can do it either way. What exactly would you like the table to look like?DCR– DCR2022-01-31 00:24:37 +00:00Commented Jan 31, 2022 at 0:24
-
Either way would be fine if you apply enough styling to make it look like a tic tac toe board - I can't really understand what the problem is. And there's loads of other ways to do it, perhaps CSS grid 3x3 would make it more straightforward to style - fewer layers.A Haworth– A Haworth2022-01-31 03:58:04 +00:00Commented Jan 31, 2022 at 3:58
-
@DCR: The question is, how to keep the inputs side-by-side if each one is not in its own TD?Tim– Tim2022-01-31 10:21:33 +00:00Commented Jan 31, 2022 at 10:21
-
a tic tac toe board is 3 by 3. How does having just three inputs suppose to work. Please edit your question and provide clearer description of the problem you are having.DCR– DCR2022-02-01 01:45:30 +00:00Commented Feb 1, 2022 at 1:45
-
@DCR. 3 TRs x 3 inputs per TR = 9. "three TRs, each with only one TD containing three INPUTs"Tim– Tim2022-02-01 15:38:09 +00:00Commented Feb 1, 2022 at 15:38
Add a comment
|
1 Answer
Really depends on what you want to do.
input{
width:50px;
height:50px;
text-align:center;}
<table>
<tr>
<td>
<input type='text' value="X">
<input type='text' value="O">
<input type='text' value="X">
</td>
</tr>
</table>
<table>
<tr>
<td>
<input type='text'>
</td>
<td>
<input type='text'>
</td>
<td>
<input type='text'>
</td>
</tr>
</table>
1 Comment
Tim
Thanks, my inputs were displaying vertically inside the TD, not three across.