Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how do I remove the space between cells of an NSTableView?

I have set the intercell spacing in my NSTableView to 0 by sending:

[self.tableView setIntercellSpacing:NSMakeSize(0, 0)];

in the window controller's awakeFromNib but there is still an (possibly 1 pixel wide) empty space between the rows, which I think is where the grid lines are drawn although I'm not using the grid lines. How can I get rid of this space between the rows?

update:

The NSTableView documentation seems to say that this 1 pixel separation should go away when the intercell separation is set to 0, 0. In my case, its not. Maybe it's a bug?

like image 655
Mike T Avatar asked Dec 07 '12 05:12

Mike T


People also ask

How do I remove the space between cells in a table?

In the past, you would remove the space between cells using the cellspacing attribute, which is now deprecated. Today, CSS suggests the border-collapse property, which specifies whether table borders are collapsed or not. Create a <table> element, which will contain <tr>, <th> and <td> tags.

How to remove cellspacing from the table using CSS?

In this snippet, we're going to show how to remove cellspacing from the table with the help of CSS. Using CSS to put a border on your <th> and <td> tags a space between them will appear. In the past, you would remove the space between cells using the cellspacing attribute, which is now deprecated.

How to close the space between tables in Google Docs?

Not a Google employee. You can't combine tables in Docs at this time, and all tables require a line space before and after them in order to work properly. So there's no way to close up the spaces between your tables. To add to a current table, just put your cursor in the last cell of the last column and press the tab key.

How to remove extra spaces from text in Excel?

You use the TRIM function in Excel removes extra spaces from text. It deletes all leading, trailing and in-between spaces except for a single space character between words. The syntax of the TRIM function is the easiest one could imagine: Where text is a cell that you want to remove excess spaces from.


1 Answers

As suggested by trudyscousin, I'll post how I fixed my problem:

As it turns out, the empty space does in fact disappear when you set the intercell spacing to 0 as I did. My problem was that the drawing code in my NSTableCellView subclass wasn't drawing all the way to the edge of the view. The gap I was seeing wasn't the intercell separation, it was the border of my NSTableCellView subclass.

like image 56
Mike T Avatar answered Oct 07 '22 12:10

Mike T