Click here to Skip to main content
15,919,245 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to indent a table row from its above row?
i want indentation with out adding the table in td.
is this possible?
XML
<table>
    <tr>
      <td>AB</td>
      <td>AB</td>
      <td>AB</td>
      <td>AB</td>
    </tr>
     <tr style="padding-left:5px;border-width:1px;border-color:Red;">
      <td>AB</td>
      <td>AB</td>
      <td>AB</td>
      <td>AB</td>
    </tr>
     <tr>
      <td>AB</td>
      <td>AB</td>
      <td>AB</td>
      <td>AB</td>
    </tr>
     <tr style="padding-left:5px;border:1px none Black;">
      <td>AB</td>
      <td>AB</td>
      <td>AB</td>
      <td>AB</td>
    </tr>
Posted
Comments
Sergey Alexandrovich Kryukov 18-Nov-11 13:46pm    
What's wrong with the code you show in the question?
--SA
amit_83 18-Nov-11 23:14pm    
i have given padding-left:5px in a row, but it does not work.
Do you have any other idea to indent a row from above row?
Sergey Alexandrovich Kryukov 19-Nov-11 0:45am    
This is not "indent". If you could explain how exactly it should look, it would be better.
--SA
amit_83 19-Nov-11 1:01am    
i want table like this
Parent Row
child Row
Parent Row
child Row

i want border also in child row, but border should be indent, i mean
from where child row starting border should start from there.
Sergey Alexandrovich Kryukov 19-Nov-11 16:32pm    
Did you try to use margin instead?
--SA

1 solution

Padding works not on element, but on its inner HTML. For example, you can use padding on the element td to make its inner text to stay distant from the boundaries of the cells. If you need to shift element itself, use CSS property margin instead.

For more detail, see the spec on the box model: http://www.w3.org/TR/2011/PR-CSS2-20110412/box.html[^].

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900