title: Make Text View and label as right aligned in UITableviewcell
body: <p>I want to make timelabel , userlabel and textstring rightaligned in cell.  So that when receiver send some message then it will displayed as right in chat application .</p>
  
  <p>How can i do that?</p>
  
  <p>My code is as below:</p>
  
  <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  {
  chatCell *cell = (chatCell *)[tableView dequeueReusableCellWithIdentifier:CHAT_CELL_IDENTIFIER];
  NSUInteger row = indexPath.row;
  if (row &lt; chatData.count)
  {
      NSString *chatText = [[chatData objectAtIndex:row] objectForKey:TEXT];
      cell.textLabel.lineBreakMode = NSLineBreakByWordWrapping;
      UIFont *font = [UIFont systemFontOfSize:14];
      CGSize size = [chatText sizeWithFont:font constrainedToSize:CGSizeMake(225.0f, 1000.0f) lineBreakMode:NSLineBreakByCharWrapping];
      cell.textString.frame = CGRectMake(75, 14, size.width +20, size.height + 20); // set text frame
      cell.textString.font = [UIFont fontWithName:FONT_NAME size:FONT_SIZE];        // set text font
      cell.textString.text = chatText;                                              // set text
      [cell.textString sizeToFit];
      NSDate *theDate = [[chatData objectAtIndex:row] objectForKey:DATE];
      NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
      [formatter setDateFormat:DATE_FORMAT];
      NSString *timeString = [formatter stringFromDate:theDate];
      cell.timeLabel.text = timeString;                                       // set timeLabel to display date and time
      cell.userLabel.text = [[chatData objectAtIndex:row] objectForKey:NAME]; // set userLabel to display userName
      if ([self.user.userName isEqualToString:cell.userLabel.text]) {
      cell.backgroundView = [[UIImageView alloc] initWithImage:[ [UIImage imageNamed:@"bubbleSomeone.png"] stretchableImageWithLeftCapWidth:21 topCapHeight:14]];
      }
      else
      {
      cell.backgroundView = [[UIImageView alloc] initWithImage:[ [UIImage imageNamed:@"bubbleMine.png"] stretchableImageWithLeftCapWidth:21 topCapHeight:14]];
      }
  }
  return cell;
  }
  
  - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
  {
  NSString *cellText = [[chatData objectAtIndex:indexPath.row] objectForKey:TEXT];
  UIFont *cellFont = [UIFont fontWithName:FONT_NAME size:FONT_SIZE];
  CGSize constraintSize = CGSizeMake(225.0f, MAXFLOAT);
  CGSize labelSize = [cellText sizeWithFont:cellFont constrainedToSize:constraintSize lineBreakMode:NSLineBreakByWordWrapping];
  return labelSize.height + 40;
  }
  </code></pre>
  
  <p>For this i think i have to align frame as right..How can i align rightalignment to frame??</p>