You are on page 1of 3

Border attribute

Cell Width

<!DOCTYPE html> <html> <body> <h4>With a normal border:</h4> <table border="1"> <tr> <td>First</td> <td>Row</td> </tr> <tr> <td>Second</td> <td>Row</td> </tr> </table> <h4>With a thick border:</h4> <table border="8"> <tr> <td>First</td> <td>Row</td> </tr> <tr> <td>Second</td> <td>Row</td> </tr> </table> h4>With a very thick border:</h4> <table border="15"> <tr> <td>First</td> <td>Row</td> </tr> <tr> <td>Second</td> <td>Row</td> </tr> </table> </body> </html>

<table border="1" width="100%"> <tr> <th>Month</th> <th>Savings</th> </tr> <tr> <td width="70%">January</td> <td width="30%">$100</td> </tr> <tr> <td>February</td> <td>$80</td> </tr> </table>

and is not supported in html 4.Aligning Text <!DOCTYPE html> <html> <head> <style type="text/css"> h1 {text-align:center} h2 {text-align:left} h3 {text-align:right} </style> </head> <body> <h1>This is heading 1</h1> <h2>This is heading 2</h2> <h3>This is heading 3</h3> </body> </html> Adding Colors to Table <!doctype html> <html> <body> <p><font color="red">this is some text!</font></p> <p><b>note:</b> if using color names.</p> </body> </html> Adding Colors to Table <!DOCTYPE html> <html> <body> <table border="1"> <tr> <th>Month</th> <th>Savings</th> . the color attribute was deprecated in html 4.</p> <p><b>tip:</b> to produce equal results in all browsers. use css instead. always use hex code to specify colors.0 strict dtd.01 strict dtd or in xhtml 1. different browsers may render different colors. and firefox have problems if the attribute value is in rgb code (will not display correct color).</p> <p>however.

Use CSS instead. Use CSS instead.</p> <p>However.</tr> <tr> <td bgcolor="#FF0000">January</td> <td bgcolor="#00FF00">$100</td> </tr> </table> <p><b>Note:</b> If using color names.0 Strict DTD.</p> </body> </html> Table Align <!DOCTYPE html> <html> <body> <table border="1" align="right"> <tr> <th>Month</th> <th>Savings</th> </tr> <tr> <td>January</td> <td>$100</td> </tr> <tr> <td>February</td> <td>$80</td> </tr> </table> <p>The align attribute allows text to be wrapped around the table.01 Strict DTD or in XHTML 1. and is not supported in HTML 4.0 Strict DTD. always use hex code to specify colors.</p> <p><b>Tip:</b> To produce equal results in all browsers. and Firefox have problems if the attribute value is in RGB code (will not display correct color). different browsers may render different colors. and is not supported in HTML 4.</p> <p>The align attribute was deprecated in HTML 4.01 Strict DTD or in XHTML 1.</p> </body> </html> . the bgcolor attribute was deprecated in HTML 4.