Sie sind auf Seite 1von 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>

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, 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><b>tip:</b> to produce equal results in all browsers, always use hex code to specify colors.</p> <p>however, the color attribute was deprecated in html 4, and is not supported in html 4.01 strict dtd or in xhtml 1.0 strict dtd. use css instead.</p> </body> </html> Adding Colors to Table <!DOCTYPE html> <html> <body> <table border="1"> <tr> <th>Month</th> <th>Savings</th>

</tr> <tr> <td bgcolor="#FF0000">January</td> <td bgcolor="#00FF00">$100</td> </tr> </table> <p><b>Note:</b> If using color names, 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><b>Tip:</b> To produce equal results in all browsers, always use hex code to specify colors.</p> <p>However, the bgcolor attribute was deprecated in HTML 4, and is not supported in HTML 4.01 Strict DTD or in XHTML 1.0 Strict DTD. Use CSS instead.</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.</p> <p>The align attribute was deprecated in HTML 4, and is not supported in HTML 4.01 Strict DTD or in XHTML 1.0 Strict DTD. Use CSS instead.</p> </body> </html>

Das könnte Ihnen auch gefallen