Advance Table Formatting

Applying Borders by Using Styles

Applying Borders by Using Styles InHTML5 You can also apply borders by using cascading style sheets (CSS), which is the most flexible and consistent method. There are certain attributes that are used <table> and <td> tags. The border-width attribute controls the thickness of the border. Specify a value in pixels. The border-color attribute controls the color of the border. Specify a color by …

Applying Borders by Using Styles Read More »

Setting Cell Padding

Setting Cell Padding To set the padding for the entire table, use the cellpadding attribute in the <table> tag. Like :- <table cellpadding=”4px”> To set the padding for an individual cell, use the padding attribute in a style. Like :- <td style=”padding: 4px”>

Setting Horizontal and Vertical Alignment

Setting Horizontal and Vertical Alignment A cell’s content has two alignments: vertical (top, middle, or bottom) and horizontal (left, center, right, or justify). To set alignment with attributes, use the align attribute to specify the horizontal alignment and the valign attribute to specify the vertical alignment. Like :- <td align=”center” valign=”middle”> You can also set alignment with a style by using text-align to specify …

Setting Horizontal and Vertical Alignment Read More »