54 Chapter 2: The HTML Language or height that is a percentage of what is available to the element. Example shows a floated table with a width attribute. The tr element defines a table row, and the th and td elements define table cells. Tables are discussed in more detail later in this chapter. Example : An HTML table with width and float attributes Example body { padding: 30px; line-height: ; } td { text-align: right; padding: 5px; } th { text-align: left; padding: 5px; } Final Exam Results PointsGrade Larry86B+ Heidi91A The. | 54 Chapter 2 The HTML Language or height that is a percentage of what is available to the element. Example shows a floated table with a width attribute. The tr element defines a table row and the th and td elements define table cells. Tables are discussed in more detail later in this chapter. Example An HTML table with width and float attributes DOCTYPE html html head title Example title style type text css body padding 30px line-height td text-align right padding 5px th text-align left padding 5px style head body h2 align center Final Exam Results h2 table width 33 align right hspace 12 border 1 tr th th th Points th th Grade th tr tr th Larry th td 86 td td B td tr tr th Heidi th td 91 td td A td tr table p The final exam required students to create an HTML page containing a floating table. Larry lost a number of points because he used em align em and em hspace em attributes in the table statement instead of using the CSS em float em and em padding em properties in his entry entitled cite Example cite . p body html Note the use of the cite element to mark up a title. Figure shows how this HTML appears in a browser. From the Library of Wow eBook HTML Attributes 55 Figure HTML page with a floating table element EVENT HANDLERS Another class of HTML global attributes is used to specify what actions browsers should take when the user interacts with an element. These event handlers take as their values one or more JavaScript statements. Typically the value consists of a call to a JavaScript function defined in the document s head or in an external file and this function does all the work. For example if you had an input form on a web page that requested the user s email address you might add the onchange attribute to call a function that checks that the input represents a valid email address. The HTML element would look like this input type text onchange check_emai l _address thi s .value In the late twentieth century web developers built