The CSS of this attribute defines the boundaries and element content between the filled space elements.
Let's look at several examples.
The code is as follows: |
Copy code |
<Html> <Head> <Style type = "text/css"> Td. test1 {padding: 1.5} Td. test2 {padding: 0.5 2.5} </Style> </Head> <Body> <Table border = "1"> <Tr> <Td class = "test1"> This is a tablecell with equal padding on each side. </Td> </Tr> </Table> <Br/> <Table border = "1"> <Tr> <Td class = "test2"> This tablecell has a top and bottom padding of 0.5 and a left and right padding of 2.5. </Td> </Tr> </Table> </Body> |
Set the value of padding-top cm
This example shows how to set the value of filling a table cell with centimeters at the top.
The code is as follows: |
Copy code |
<Html> <Head> <Style type = "text/css"> Td {padding-top: 2 cm} </Style> </Head> <Body> <Table border = "1"> <Tr> <Td> This is a tablecell with a top padding </Td> </Tr> </Table> </Body> </Html> |