HTML <fieldset> form Attribute

Example A <fieldset> element located outside a form (but still a part of the form): <form action=”/action_page.php” method=”get” id=”form1″> What is your favorite color? <input type=”text” name=”fav_color”><br> <input type=”submit”> </form> <fieldset form=”form1″> Name: <input type=”text” name=”username”><br> Email: <input type=”text” name=”usermail”><br> </fieldset> Try it Yourself » Definition and Usage The form attribute specifies one or more forms the fieldset belongs to. Browser Support Attribute form Not supported Not supported Not […]

HTML <fieldset> disabled Attribute

Example Disable a group of related form elements: <fieldset disabled> <legend>Personalia:</legend> Name: <input type=”text”><br> Email: <input type=”text”><br> Date of birth: <input type=”text”> </fieldset> Try it Yourself » Definition and Usage The disabled attribute is a boolean attribute. When present, it specifies that a group of related form elements (a fieldset) should be disabled. A disabled fieldset is unusable and un-clickable. The disabled […]

HTML <legend> Tag

Example Group related elements in a form: <form> <fieldset> <legend>Personalia:</legend> Name: <input type=”text” size=”30″><br> Email: <input type=”text” size=”30″><br> Date of birth: <input type=”text” size=”10″> </fieldset> </form> Try it Yourself » Definition and Usage The <legend> tag defines a caption for the <fieldset> element. Browser Support Element <legend> Yes Yes Yes Yes Yes Differences Between HTML 4.01 and HTML5 The “align” attribute is not supported in HTML5. […]

HTML <th> scope Attribute

Example Specify that the two header cells are headers for columns: <table> <tr> <th></th> <th scope=”col”>Month</th> <th scope=”col”>Savings</th> </tr> <tr> <td>1</td> <td>January</td> <td>$100</td> </tr> <tr> <td>2</td> <td>February</td> <td>$80</td> </tr> </table> Try it Yourself » Definition and Usage The scope attribute specifies whether a header cell is a header for a column, row, or group of columns or […]

HTML <th> valign Attribute

Example Vertical align the content inside <th> elements: <table> <tr> <th valign=”bottom”>Month</th> <th valign=”bottom”>Savings</th> </tr> <tr> <td>January</td> <td>$100</td> </tr> </table> Try it Yourself » Definition and Usage The valign attribute specifies the vertical alignment of the content in a header cell. Browser Support Attribute valign Yes Yes Yes Yes Yes Compatibility Notes The valign attribute of <th> […]

HTML <th> width Attribute

Example Header cells with a predefined width: <table> <tr> <th width=”70%”>Month</th> <th width=”30%”>Savings</th> </tr> <tr> <td>January</td> <td>$100</td> </tr> <tr> <td>February</td> <td>$80</td> </tr> </table> Try it Yourself » Definition and Usage The width attribute specifies the width of a table header cell. Normally, a cell takes up the space it needs to display the content. The width attribute […]

HTML <th> rowspan Attribute

Example An HTML table with a header cell that spans three rows: <table> <tr> <th>Month</th> <th>Savings</th> <th rowspan=”3″>Savings for holiday!</th> </tr> <tr> <td>January</td> <td>$100</td> </tr> <tr> <td>February</td> <td>$80</td> </tr> </table> Try it Yourself » More “Try it Yourself” examples below. Definition and Usage The rowspan attribute defines the number of rows a header cell should span. […]

HTML <th> nowrap Attribute

Example A header cell with a nowrap attribute: <table> <tr> <th>Month</th> <th nowrap>My Savings for a new car</th> </tr> <tr> <td>January</td> <td>$100</td> </tr> <tr> <td>February</td> <td>$80</td> </tr> </table> Try it Yourself » Definition and Usage The nowrap attribute is a boolean attribute. When present, it specifies that the content inside a header cell should not wrap. […]

HTML <th> height Attribute

Example Two header cells with a predefined height: <table> <tr> <th height=”100″>Month</th> <th height=”100″>Savings</th> </tr> <tr> <td>January</td> <td>$100</td> </tr> <tr> <td>February</td> <td>$80</td> </tr> </table> Try it Yourself » Definition and Usage The height attribute specifies the height of a header cell. If no height attribute is set, a header cell takes up the space it needs to […]

HTML <th> headers Attribute

Example Specify the <th> element each header cell is related to: <table> <tr> <th id=”name” colspan=”2″>Name</th> </tr> <tr> <th headers=”name”>Firsname</th> <th headers=”name”>Lastname</th> </tr> </table> Try it Yourself » Definition and Usage The headers attribute specifies one or more header cells a header cell is related to. Browser Support Attribute headers Yes Yes Yes Yes Yes The headers attribute has […]

HTML <th> colspan Attribute

Example An HTML table with a header cell that spans two columns: <table> <tr> <th colspan=”2″>Monthly Savings</th> </tr> <tr> <td>January</td> <td>$100</td> </tr> <tr> <td>February</td> <td>$80</td> </tr> </table> Try it Yourself » Definition and Usage The colspan attribute defines the number of columns a header cell should span. Browser Support Attribute colspan Yes Yes Yes Yes Yes […]

HTML <th> char Attribute

Example Align the content of the first header cell to the “M” character: <table> <tr> <th align=”char” char=”M”>Month</th> <th>Savings</th> </tr> <tr> <td>January</td> <td>$100.00</td> </tr> <tr> <td>February</td> <td>$10.00</td> </tr> </table> Try it Yourself » Definition and Usage The <th> char attribute is not supported in HTML5. The char attribute specifies the alignment of the content in a header […]

HTML <th> bgcolor Attribute

Example Add a background color to header cells: <table> <tr> <th bgcolor=”#FF0000″>Month</th> <th bgcolor=”#00FF00″>Savings</th> </tr> <tr> <td>January</td> <td>$100</td> </tr> </table> Try it Yourself » Definition and Usage The bgcolor attribute specifies the background color of a header cell. Browser Support Attribute bgcolor Yes Yes Yes Yes Yes Compatibility Notes The bgcolor attribute of <th> is not supported […]

HTML <th> axis Attribute

Example An HTML table with categorized header cells: <table> <tr> <th axis=”name”>Name</td> <th axis=”contact”>Email</td> <th axis=”contact”>Phone</td> <th axis=”contact”>Address</td> </tr> <tr> <td>John Doe</td> <td>someone@example.com</td> <td>+45342323</td> <td>Rosevn 56,4300 Sandnes,Norway</td> </tr> </table> Try it Yourself » Definition and Usage The <th> axis attribute is not supported in HTML5. The axis attribute is used to categorize header cells. The axis attribute can be […]

HTML <th> align Attribute

Example Left-align the content in the header cells: <table> <tr> <th align=”left”>Month</th> <th align=”left”>Savings</th> </tr> <tr> <td>January</td> <td>$100</td> </tr> </table> Try it Yourself » Definition and Usage The align attribute specifies the horizontal alignment of the content in a header cell. Browser Support Attribute align Yes Yes Yes Yes Yes Note: None of the major browsers handles the […]

HTML <th> abbr Attribute

Example Use of the abbr attribute in an HTML table: <table> <tr> <th abbr=”Make”>Toy manufacturer</th> <th abbr=”Model”>Vehicle model</th> </tr> <tr> <td>Bruder Toys</td> <td>Cross Country Vehicle</td> </tr> <tr> <td>Bruder Toys</td> <td>DHL Lorry</td> </tr> </table> Try it Yourself » Definition and Usage The abbr attribute specifies a shorter version of the content in a header cell. Browser Support Attribute […]

HTML <thead> valign Attribute

Example Vertical align the content inside the <thead> element to the bottom: <table> <thead valign=”bottom”> <tr> <th>Month</th> <th>Savings</th> </tr> </thead> <tr> <td>January</td> <td>$100</td> </tr> <tr> <td>February</td> <td>$80</td> </tr> </table> Try it Yourself » Definition and Usage The <thead> valign attribute is not supported in HTML5. Use CSS instead. The valign attribute specifies the vertical alignment of […]

HTML <thead> charoff Attribute

Example Align the content inside the <thead> two characters to the right from the “M” character: <table> <thead align=”char” char=”M” charoff=”2″> <tr> <th>Month</th> <th>Savings</th> </tr> </thead> <tr> <td>January</td> <td>$100</td> </tr> <tr> <td>February</td> <td>$80</td> </tr> </table> Try it Yourself » Definition and Usage The <thead> charoff attribute is not supported in HTML5. The charoff attribute sets the number of […]

HTML <thead> char Attribute

Example Align the content inside the <thead> element to the “M” character: <table> <thead align=”char” char=”M”> <tr> <th>Month</th> <th>Savings</th> </tr> </thead> <tr> <td>January</td> <td>$100</td> </tr> <tr> <td>February</td> <td>$80</td> </tr> </table> Try it Yourself » Definition and Usage The <thead> char attribute is not supported in HTML5. The char attribute specifies the alignment of the content inside the […]