I'm using checkbox image in Jface tableviewer column, I want to show the checkbox image in center of the table column. Please check the attached image and share your thoughts to resolve this issue. Thanks in advance,
customizedTableViewer = new TableViewer(parent, SWT.BORDER | SWT.FULL_SELECTION);
customizedTable.setLinesVisible(true);
customizedTable.setHeaderVisible(true);
customizedTable.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
TableColumn refTemplateTblclmnColumn = new TableColumn(customizedTable, SWT.NONE);
refTemplateTblclmnColumn.setWidth(180);
refTemplateTblclmnColumn.setText(TextResources.TEMPLATE_COLUMN);
TableColumn hospitalTblclmnColumn = new TableColumn(customizedTable, SWT.NONE);
// I have tried following code but it's not working.
hospitalTblclmnColumn.setAlignment(SWT.CENTER);
hospitalTblclmnColumn.setWidth(100);
hospitalTblclmnColumn.setText(TextResources.EL_HSP_COLUMN);
TableColumn providerTblclmnColumn = new TableColumn(customizedTable, SWT.NONE);
providerTblclmnColumn.setWidth(100);
providerTblclmnColumn.setText(TextResources.EL_PROVIDER_COLUMN);

The SWT.CENTER style only centers the text. For normal label providers there is no way to get a centered image. You need to draw the column yourself using something based on
OwnerDrawLabelProvider.The best thing to do is use
TableViewerColumnrather thanTableColumnso that you can set a separate label provider for each column. The columns you want to have a centered image can use an owner draw label provider like this: