Tables attributes - PowerPoint PPT Presentation

1 / 7
About This Presentation
Title:

Tables attributes

Description:

Table attributes: cellpadding and cellspacing. cellpadding table attribute. Amount of space in pixels between the contents of the cells and the cell walls ... – PowerPoint PPT presentation

Number of Views:36
Avg rating:3.0/5.0
Slides: 8
Provided by: barbar81
Category:

less

Transcript and Presenter's Notes

Title: Tables attributes


1
Tables attributes
2
Table attributes border
  • Activates border around cells
  • Syntax
  • lttable borderngt where n is a value in pixels
    which controls the thickness of the border

Note this attribute can ONLY be used in a
transitional doctype.
3
Table attributes width
  • May be set in pixels or as a of the screen
    size
  • lttable width95gt

Note this attribute can ONLY be used in a
transitional doctype.
4
Table attributes cellpadding and cellspacing
  • cellpadding
  • lttablegt attribute
  • Amount of space in pixels between the contents of
    the cells and the cell walls
  • Syntax
  • lttable cellpadding5gt
  • cellspacing
  • lttablegt attribute
  • Amount of space between cells
  • Syntax
  • lttable cellspacing2gt

Note this attribute can ONLY be used in a
transitional doctype.
5
Table cells height and width
  • May be set in pixels or as a percentage
  • lttd width200gtOnelt/tdgt
  • Use CSS in XHTML strict DTD
  • th, td height 100px width 200px
  • Certain rules apply to width
  • lttablegt values will override lttdgt values
  • Specify width at cell level when specification is
    necessary

6
Adding style
  • Presentation without attributes
  • Open the file onepixelborders.html in notepad in
    the activity
  • What style has been added?

td border 1px solid black
7
ltstyle type"text/css"gt td
border 1px solid black lt/stylegt
  • table
  • border-collapse collapse
  • border 1px solid black

Add some more style see what happens
th text-align left background gray color
white padding 0.2em
padding 0.2em
Write a Comment
User Comments (0)
About PowerShow.com