public static IWriter2 <T, TableRowContent> Cells <T>(this IWriter2 <T, TableRowContent> target, object value) where T : TableRow { var tcw = value as IWriter2 <TableCell, AnyContent>; if (tcw != null) { target.Item.AddCell(tcw.Item); return(target); } var tc = value as TableCell; if (tc != null) { target.Item.AddCell(tc); return(target); } tc = new TableCell(); tc.AddContent(value); target.Item.AddCell(tc); return(target); }