0

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?

5
  • your question doesn't make sense. You can do it either way. What exactly would you like the table to look like? Commented 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. Commented 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? Commented 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. Commented 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" Commented Feb 1, 2022 at 15:38

1 Answer 1

1

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>

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks, my inputs were displaying vertically inside the TD, not three across.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.