George and Susan Welcome to our HTML help page!
Home | HTML-Index | Basic HTML | HTML Structure

CHANGE THE SIZE OF A CELL



Changing the size of a cell (<TH> OR <TD>) in a table can help improve the layout of the table. Use the WIDTH attribute to specify a new width for a cell in pixels or as a percentage of the table. The HEIGHT attribute lets you specify a new height for a cell in pixels.

You do not need to change the size of each individual cell in your table. When you change the width of a cell, all the cells in the same column will display the new width. When you change the height of a cell in the same row will display the new height.

If you specify a width or height that is smaller then the contents of the cell in the column or row a Web browser will display the column or row as small as the content of the cell allows.

Type this:
down
<TABLE BORDER=3 ALIGN=CENTER>
<TR>
        <TH WIDTH="200" HEIGHT="80">your text here</TH>
        <TH>your text here</TH>
        <TH>your text here</TH>
</TR>
<TR>
<TD ALIGN=CENTER>your text or image</TD>
<TD ALIGN=CENTER>your text or image</TD>
<TD ALIGN=CENTER>your text or image</TD>
</TR>
<TR>
<TD ALIGN=CENTER>your text or image</TD>
<TD ALIGN=CENTER>your text or image</TD>
<TD ALIGN=CENTER>your text or image</TD>
</TR>
</TABLE>



And you get the following:
down
your text here your text here your text here
your text or image your text or image your text or image
your text or image your text or image your text or image


My home page
Back to Top