Skip to Content
0
Former Member
Aug 03, 2005 at 08:34 PM

How to align Table cells

46 Views

Hi

I want align data to top in particular columns

Actually i am adding multiple lines for some columns

for that the other cells pertaining to that row aligned centered.

for that reason i made column encode false and added <BR>

to other cells data

those are working fine

but i got problem with date columns in which because of <br> date field is converting into string and displaying entire date month day and time

i tried to use cellVAlignment in hbj:tableview

then it is throwing error stating that this element not

found in htmlb tags

please see my code

<hbj:tableView id="myTableView"

model = "myBean.model"

design = "ALTERNATING"

headerVisible = "true"

footerVisible = "false"

fillUpEmptyRows = "true"

navigationMode = "BYLINE"

headerText = "Leader Status OverView"

onNavigate = "onNavigation"

>

public Vector createLeaderStatusTableData(IRecordSet _hdrtable, IRecordSet _dattable) {

Vector dataVec = new Vector();

Vector retVector = new Vector();

IRecordSet hdrtable = _hdrtable;

IRecordSet datatable = _dattable;

String strtmpobjview = this.getObjview();

try{

hdrtable.beforeFirst();

while (hdrtable.next()){

if(!hdrtable.getString("DOC_APPRAISEE_NAME").trim().equals("")){

dataVec = new Vector();

if(strtmpobjview.equalsIgnoreCase("YES")){

String tmpitmstr = "<a href='somjunk'> <B>"hdrtable.getString("DOC_APPRAISAL_NAME")"</B></a>" ;

String tmpwtstr = "<B>"hdrtable.getString("DOC_WEIGHTING")"</B>" ;

String myspace = "<BR> ";

datatable.beforeFirst();

while (datatable.next()){

if(datatable.getString("APPRAISAL_ID").equals(hdrtable.getString("APPRAISAL_ID"))){

tmpitmstr=tmpitmstr"<BR>"datatable.getString("ITM_TITLE");

tmpwtstr=tmpwtstr"<BR>"datatable.getString("ITM_WEIGHTING");

myspace = myspace+"<BR> " ;

}

}

dataVec.addElement(hdrtable.getString("DOC_APPRAISEE_NAME")+myspace);

dataVec.addElement(hdrtable.getString("DOC_TRFGR")+myspace);

dataVec.addElement(tmpitmstr);

dataVec.addElement(tmpwtstr);

dataVec.addElement(hdrtable.getString("DOC_STATUS")+myspace);

dataVec.addElement(hdrtable.getDate("DOC_AP_START_DATE"));

dataVec.addElement(hdrtable.getDate("DOC_AP_END_DATE"));

}

else{

dataVec.addElement(hdrtable.getString("DOC_APPRAISEE_NAME"));

dataVec.addElement(hdrtable.getString("DOC_TRFGR"));

dataVec.addElement(hdrtable.getString("DOC_APPRAISAL_NAME"));

dataVec.addElement(hdrtable.getString("DOC_WEIGHTING"));

dataVec.addElement(hdrtable.getString("DOC_STATUS"));

dataVec.addElement(hdrtable.getDate("DOC_AP_START_DATE"));

dataVec.addElement(hdrtable.getDate("DOC_AP_END_DATE"));

}

retVector.addElement(dataVec);

}

}

}catch(Exception te){

}

return retVector ;

}