Adding a FONT to an ASP.net Table

I am trying to make the whole table color=“aqua”.

No matter where I put the FONT it gives me an error.

Is there another way of writing the FONT to use in asp.net 2.0

<font color="aqua">
     <center><table border="1">
    	<tr><td>Text1/td>
              <td>Text2</td>
              <td>Text3</td></tr>
	<tr><td>Text4</td>
              <td>Text5</td>
              <td>Text6</td></tr>
     </table></center>
</font>

I know nothing about ASP.NET, but that looks like HTML to me?

And what error are you getting?

This is in MySite.aspx

<body id=“Body1” runat=“server”>
<form id=“form1” runat=“server”>
<div id = “heading”>

<font color=“aqua”>
<center><table border=“1”>
<tr><td>Text1/td>
<td>Text2</td>
<td>Text3</td></tr>
<tr><td>Text4</td>
<td>Text5</td>
<td>Text6</td></tr>
</table></center>
</font>

</div>
</form>
</body>

Error code - Elements “Table” or “center” cannot be nested within element “font”.

The font tag was deprecated years ago (in strict doctypes) and has no place in modern sites. It’s an inline element anyway and cannot contain block elements.

Remove the font tag and remove the center tag and apply a class to the table instead.
e.g.


<body>
<table[B] class="my-table"[/B]>
		<tr>
				<td>Text1</td> 
				<td>Text2</td>
				<td>Text3</td>
		</tr>
		<tr>
				<td>Text4</td>
				<td>Text5</td>
				<td>Text6</td>
		</tr>
</table>


Then add this css to your main css file:


.my-table{
	margin:auto;
	border:1px solid #000;
	color:#0ff;
}
.my-table td{border:1px solid #000}

Hope that helps.