Table Viewer - Can the extra padding on each table cell be removed [message #669882] |
Wed, 11 May 2011 23:35 |
Pavan K Immaneni 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
|
|
|
Powered by
FUDForum. Page generated in 0.03308 seconds