input:focus border: 2px solid #000000;
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en-US"> <head> <title>Spreadsheet form</title> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <style> table.formdata { border: 1px solid #5F6F7E; border-collapse: collapse; margin: 1em 0 2em 0; } table.formdata th { border: 1px solid #5F6F7E; background-color: #E2E2E2; color: #000000; text-align: left; font-weight: normal; padding: 0.2em 0.4em 0.2em 0.4em; margin: 0; } table.formdata td { margin: 0; padding: 0; border: 1px solid #E2E2E2; } table.formdata input { width: 80px; padding: 0.2em 0.4em 0.2em 0.4em; margin: 0; border: 2px solid #FFFFFF; } .formdata input:focus, .formdata input.hilite { border: 2px solid #000000; } </style> </head> <body> <form method="post" action="spreadsheet.html"> <table class="formdata" id="form1" summary="This table contains a form"> <caption>Complete the Yearly Income 1999 - 2002</caption> <tr> <th></th> <th scope="col">1999</th> <th scope="col">2000</th> <th scope="col">2001</th> <th scope="col">2002</th> </tr> <tr> <th scope="row">Grants</th> <td><input type="text" name="c1999" id="c1999" /></td> <td><input type="text" name="c2000" id="c2000" /></td> <td><input type="text" name="c2001" id="c2001" /></td> <td><input type="text" name="c2002" id="c2002" /></td> </tr> <tr> <th scope="row">Donations</th> <td><input type="text" name="d1999" id="d1999" /></td> <td><input type="text" name="d2000" id="d2000" /></td> <td><input type="text" name="d2001" id="d2001" /></td> <td><input type="text" name="d2002" id="d2002" /></td> </tr> <tr> <th scope="row">Investments</th> <td><input type="text" name="w1999" id="w1999" /></td> <td><input type="text" name="w2000" id="w2000" /></td> <td><input type="text" name="w2001" id="w2001" /></td> <td><input type="text" name="w2002" id="w2002" /></td> </tr> <tr> <th scope="row">Fundraising</th> <td><input type="text" name="y1999" id="y1999" /></td> <td><input type="text" name="y2000" id="y2000" /></td> <td><input type="text" name="y2001" id="y2001" /></td> <td><input type="text" name="y2002" id="y2002" /></td> </tr> <tr> <th scope="row">Sales</th> <td><input type="text" name="q1999" id="q1999" /></td> <td><input type="text" name="q2000" id="q2000" /></td> <td><input type="text" name="q2001" id="q2001" /></td> <td><input type="text" name="q2002" id="q2002" /></td> </tr> <tr> <th scope="row">Miscellaneous</th> <td><input type="text" name="m1999" id="m1999" /></td> <td><input type="text" name="m2000" id="m2000" /></td> <td><input type="text" name="m2001" id="m2001" /></td> <td><input type="text" name="m2002" id="m2002" /></td> </tr> <tr> <th scope="row">Total</th> <td><input type="text" name="total1999" id="total1999" /></td> <td><input type="text" name="total2000" id="total2000" /></td> <td><input type="text" name="total2001" id="total2001" /></td> <td><input type="text" name="total2002" id="total2002" /></td> </tr> </table> <div><input type="submit" name="btnSubmit" id="btnSubmit" value="Add Data" /></div> </form> </body> </html>