Question: with the transition on iOS7 the separator has 15px padding on left. I know that i can remove this padding with separator inset feature on the UITableView setting in the xib file, but i need to keep heading text with padding. How to do it?

default:

![enter image description here](https://i.stack.imgur.com/Zmuay.png)

with custom on separator inset to 0:

![enter image description here](https://i.stack.imgur.com/ou9bX.png)

i need to keep separators like figure 2, but the header with "2013" like picture 1.

Answer: 
`UITableView` has a delegate method named `viewForHeaderInSection`. If you remove the padding an then in the delegate method add a padding and return the section header view.

```
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
    UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(tableView.frame), 30)];
    UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(15, 5, 200, 25)];

    // 15 pixel padding will come from CGRectMake(15, 5, 200, 25).
    label.text = @"2013";
    [view addSubview: label];
    return view;
}

```

You can design you header view how ever you like. For setting the height of the tableView header use:

```
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section;

```

Hope it helps you... )
You can set insets on table (and header/footer) and on the cell itself:

```
-(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath{    
    if ([tableView respondsToSelector:@selector(setSeparatorInset:)]) {
        [tableView setSeparatorInset:UIEdgeInsetsMake(0, 10, 0, 0)];
    }    
    if ([tableView respondsToSelector:@selector(setLayoutMargins:)]) {
        [tableView setLayoutMargins:UIEdgeInsetsMake(0, 10, 0, 0)];
    }
    if ([cell respondsToSelector:@selector(setLayoutMargins:)]) {
        [cell setLayoutMargins:UIEdgeInsetsZero];
    }
}

```