Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » Table Viewer - Can the extra padding on each table cell be removed
Table Viewer - Can the extra padding on each table cell be removed [message #669882] Wed, 11 May 2011 23:35
Pavan K Immaneni is currently offline Pavan K ImmaneniFriend
Messages: 20
Registered: July 2009
Junior Member
I have a table viewer with 2 rows and 80 columns created.

Each of the table cells would contain a maximum of 2 characters and based on this I am trying to remove the extra padding in each cell and could not figure this out.

Here is how the code looks like..

// Code to create the table viewer and columns
int style = SWT.BORDER | SWT.FULL_SELECTION | SWT.HIDE_SELECTION;
TableViewer tableViewer = new TableViewer(parent, style);

int maximumWidth = 80;
String tableColumnNames[] = new String[maximumWidth];
for (int i = 0; i < maximumWidth; i++){
tableColumnNames[i] = String.valueOf(i);
TableViewerColumn column = new TableViewerColumn(tableViewer, SWT.NONE);
column.getColumn().setWidth(30);
}

// Code to set text in to each cell
// tableViewer.setInput(model);

// Now that we've set the text into the columns,
// we call pack() on each one to size it to the
// contents.
for (int i = 0; i < tableViewer.getTable().getColumnCount(); i++) {
TableColumn column = tableViewer.getTable().getColumn(i);
column.pack();
}

Even with the above code, I see that there is lot of extra padding on each table cell. Is it possible to remove the extra cell padding in each table cell ?

Any other ideas ? Please help.

Thanks,
Pavan
Previous Topic:Table Viewer - Can the extra padding on each table cell be removed
Next Topic:How do I scroll to an ExpandItem in an ExpandBar?
Goto Forum:
  


Current Time: Thu Apr 25 11:39:58 GMT 2024

Powered by FUDForum. Page generated in 0.03308 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top