Hi every one.This is my first post .
Okay using example I was able to draw a table as in pic under

and code I used is as in jsp I used this script
<script type="text/javascript">
//Load the Visualization API and the ready-made Google table visualization
google.load('visualization', '1', {'packages':['table']});
// Set a callback to run when the API is loaded.
google.setOnLoadCallback(init);
// Send the query to the data source.
function init() {
// Specify the data source URL.
var query = new google.visualization.Query('TrTimeTbl');
// Send the query with a callback function.
query.send(handleQueryResponse);
}
// Handle the query response.
function handleQueryResponse(response) {
if (response.isError()) {
alert('Error in query: ' + response.getMessage() + ' ' + response.getDetailedMessage());
return;
}
// Draw the visualization.
var data = response.getDataTable();
var chart = new google.visualization.Table(document.getElementById('pDetails'));
chart.draw(data, {width: 642, height: 230, allowHTML: true});
}
</script>
and in servlet its like this
public class TrTimeTbl extends DataSourceServlet {
private static final long serialVersionUID = 5300414516532629857L;
@Override
public DataTable generateDataTable(Query query, HttpServletRequest request) {
// Create a data table.
DataTable data = new DataTable();
ArrayList<ColumnDescription> cd = new ArrayList<ColumnDescription>();
ColumnDescription cdd = new ColumnDescription("hh", ValueType.NUMBER, "hh");
cdd.setCustomProperty("text-align", "center");
cd.add(cdd);
/*cd.add(new ColumnDescription("Period", ValueType.NUMBER, "Period"));*/
cd.add(new ColumnDescription("Class", ValueType.TEXT, "Class"));
cd.add(new ColumnDescription("Subect", ValueType.TEXT, "Subject"));
data.addColumns(cd);
//getting data from database
TrHome trHome = new TrHome();
List<TimeTablePojo> listTable = trHome.getTimeTableDetails("****", "****");
// Fill the data table.
try {
for(TimeTablePojo tempTable : listTable){
data.addRowFromValues(tempTable.getPeriod(), tempTable.getClas(), tempTable.getSub());
}
} catch (TypeMismatchException e) {
System.out.println("Invalid type!");
}
return data;
}
Its working fine I only need that the data displayed in columns as in picture aboe to be cnter aligned .Please suggest me how to obtain it.