81 lines
4.6 KiB
HTML
81 lines
4.6 KiB
HTML
|
<?xml version="1.0" encoding="UTF-8"?>
|
||
|
<!DOCTYPE html
|
||
|
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||
|
<html lang="en-us" xml:lang="en-us">
|
||
|
<head>
|
||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||
|
<meta name="security" content="public" />
|
||
|
<meta name="Robots" content="index,follow" />
|
||
|
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
|
||
|
<meta name="DC.Type" content="reference" />
|
||
|
<meta name="DC.Title" content="HTMLAlign class" />
|
||
|
<meta name="abstract" content="" />
|
||
|
<meta name="description" content="" />
|
||
|
<meta name="copyright" content="(C) Copyright IBM Corporation 2006" />
|
||
|
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 2006" />
|
||
|
<meta name="DC.Format" content="XHTML" />
|
||
|
<meta name="DC.Identifier" content="htmalign" />
|
||
|
<meta name="DC.Language" content="en-us" />
|
||
|
<!-- All rights reserved. Licensed Materials Property of IBM -->
|
||
|
<!-- US Government Users Restricted Rights -->
|
||
|
<!-- Use, duplication or disclosure restricted by -->
|
||
|
<!-- GSA ADP Schedule Contract with IBM Corp. -->
|
||
|
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
|
||
|
<link rel="stylesheet" type="text/css" href="./ic.css" />
|
||
|
<title>HTMLAlign class</title>
|
||
|
</head>
|
||
|
<body id="htmalign"><a name="htmalign"><!-- --></a>
|
||
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
||
|
<h1 class="topictitle1">HTMLAlign class</h1>
|
||
|
<div><p></p>
|
||
|
<div class="section"><p>The <a href="javadoc/com/ibm/as400/util/html/HTMLAlign.html"> HTMLAlign</a> class enables you to align sections
|
||
|
of your HTML document, instead of just aligning individual items, say paragraphs
|
||
|
or headings.</p>
|
||
|
<p>The HTMLAlign class represents the <DIV> tag and its
|
||
|
associated align attribute. You can use right, left, or center alignment.</p>
|
||
|
<p>You
|
||
|
can use this class to perform a variety of actions that include the following:</p>
|
||
|
<ul><li><a href="javadoc/com/ibm/as400/util/html/HTMLAlign.html#ADDITEM(COM.IBM.AS400.UTIL.HTML.HTMLTAGELEMENT)"> Add</a> or <a href="javadoc/com/ibm/as400/util/html/HTMLAlign.html#REMOVEITEM(COM.IBM.AS400.UTIL.HTML.HTMLTAGELEMENT)"> remove</a> items from the list of tags you
|
||
|
want to align</li>
|
||
|
<li><a href="javadoc/com/ibm/as400/util/html/HTMLAlign.html#GETALIGN()">Get</a> and <a href="javadoc/com/ibm/as400/util/html/HTMLAlign.html#SETALIGN(JAVA.LANG.STRING)"> set</a> the alignment</li>
|
||
|
<li><a href="javadoc/com/ibm/as400/util/html/HTMLAlign.html#GETDIRECTION()"> Get</a> and <a href="javadoc/com/ibm/as400/util/html/HTMLAlign.html#SETDIRECTION(JAVA.LANG.STRING)"> set</a> the direction of the text interpretation</li>
|
||
|
<li><a href="javadoc/com/ibm/as400/util/html/HTMLAlign.html#GETLANGUAGE()"> Get</a> and <a href="javadoc/com/ibm/as400/util/html/HTMLAlign.html#SETLANGUAGE(JAVA.LANG.STRING)"> set</a> the language of the input element</li>
|
||
|
<li><a href="javadoc/com/ibm/as400/util/html/HTMLAlign.html#TOSTRING()">Get a String representation</a> of the HTMLAlign
|
||
|
object</li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
<div class="section" id="htmalign__htmlalignex"><a name="htmalign__htmlalignex"><!-- --></a><h4 class="sectiontitle">Example: Creating HTMLAlign objects</h4><div class="p"><div class="note"><span class="notetitle">Note:</span> Read
|
||
|
the <a href="codedisclaimer.htm#codedisclaimer">Code example disclaimer</a> for
|
||
|
important legal information.</div>
|
||
|
The following example creates
|
||
|
an unordered list, then creates an HTMLAlign object to align the entire list:</div>
|
||
|
<pre> // Create an unordered list.
|
||
|
UnorderedList uList = new UnorderedList();
|
||
|
uList.setType(HTMLConstants.DISC);
|
||
|
UnorderedListItem uListItem1 = new UnorderedListItem();
|
||
|
uListItem1.setItemData(new HTMLText("Centered unordered list"));
|
||
|
uList.addListItem(uListItem1);
|
||
|
UnorderedListItem uListItem2 = new UnorderedListItem();
|
||
|
uListItem2.setItemData(new HTMLText("Another item"));
|
||
|
uList.addListItem(uListItem2);
|
||
|
|
||
|
// Align the list.
|
||
|
HTMLAlign align = new HTMLAlign(uList, HTMLConstants.CENTER);
|
||
|
System.out.println(align);</pre>
|
||
|
<p>The previous example produces
|
||
|
the following tag:</p>
|
||
|
<pre> <div align="center">
|
||
|
<ul type="disc">
|
||
|
<li>Centered unordered list</li>
|
||
|
<li>Another item</li>
|
||
|
</ul></pre>
|
||
|
<p>When you use this tag in an HTML page, it looks
|
||
|
like this:</p>
|
||
|
<ul><li>Centered unordered list</li>
|
||
|
<li>Another item</li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
</body>
|
||
|
</html>
|