Utkarsh Barsaiyan
Utkarsh Barsaiyan

Reputation: 335

Best way to draw winning line in Tic Tac Toe

I'm making Tic Tac Toe game using HTML, CSS and Javascript. For the 9 boxes I've used a table which is horizontally centred. I wish to draw a straight line across the winning combination. Should I use svg, canvas, div or anything else? enter image description here

<table>
<tr>
<td></td>


... 

</table>

Upvotes: 0

Views: 2130

Answers (1)

partizanos
partizanos

Reputation: 1126

I would propose 3 (2 invinsible 1 visible svg) lines

<svg height="210" width="500">
    <line x1="0" y1="0" x2="200" y2="200" style="stroke:rgb(255,0,0);stroke-width:2" />
</svg>

Upvotes: 2

Related Questions