How to Make Text Flush Left in a Single Cell in HTML

HTML table cells are fully customizable. Designers can change text color, background, alignment and other attributes in a cell independent of other cells in the table. Changing cell alignment may help make it easier to read and more appealing. For example, you can align the table header cell to the center while the data cells below are aligned to the left. Note that many HTML attributes, including some table attributes, are now deprecated to give way to style sheets.

Instructions

    • 1

      Open the HTML document in a text editor. Scroll down the document until you come to the "table" element containing the cell you wish to edit. The opening HTML tag for the table should look similar to <table>.

    • 2

      Find the cell to be edited. HTML has two types of cells: TH for the table header at the top of the table and TD for table cells that contain data. Whichever type of cell it is, the tag should be nestled between the TR, or table row tags, as follows:

      <tr><td></td></tr> or

      <tr><th></th></tr>

    • 3

      Add the "align" attribute name to the table cell as follows:

      <td align=""> or

      <th align="">

    • 4

      Add the attribute's value to the table cell. The value depends on the alignment you want to use. For example, "right, "left" or "justify."

      <td align="left"> or

      <th align="center">

    • 5

      Enter the text between the table cell tags, similar to the following examples:

      <td align="left">Table Cell Data</td> or

      <th align="center">Table Header</th>

    • 6

      Review the table code. It should similar to the example below:

      <table>

      <tr>

      <td align="left">Table Data</td>

      </tr>

      </table>.

    • 7

      Save the HTML document. Open the page to preview it in a Web browser such as Firefox or Internet Explorer

Related Searches:

References

Resources

Comments

You May Also Like

Related Ads

Featured