// HTML_Table.cpp: implementation of the HTML_Table class. // ////////////////////////////////////////////////////////////////////// #include "HTML_all.h" #include "HTML_Table.h" ////////////////////////////////////////////////////////////////////// // Construction/Destruction ////////////////////////////////////////////////////////////////////// HTML_Table::HTML_Table() { } HTML_Table::~HTML_Table() { } HTML_Table* HTML_Table::setCellspacing(char * x) { cellspacing = x; return(this); } HTML_Table* HTML_Table::setCellpadding(char * x) { cellpadding = x; return(this); } HTML_Table* HTML_Table::setBgcolor(char * x) { bgcolor = x; return(this); } HTML_Table* HTML_Table::setBorder(char * x) { border = x; return(this); } HTML_Table* HTML_Table::setWidth(char * x) { width = x; return(this); } const char* HTML_Table::getCellspacing() { return(cellspacing.c_str()); } const char* HTML_Table::getCellpadding() { return(cellpadding.c_str()); } const char* HTML_Table::getBgcolor() { return(bgcolor.c_str()); } const char* HTML_Table::getBorder() { return(border.c_str()); } const char* HTML_Table::getWidth() { return(width.c_str()); } string& HTML_Table::printString() { //print opening tag with options and new line buffer = "\n"); //print nested objects printStringNested(); //print closing tag and new line buffer.append("\n"); return(buffer); } HTML_Row* HTML_Table::newRow() { HTML_Row* t; t = new HTML_Row; insert(t); return(t); } HTML_Element* HTML_Table::printOptions() { if(cellpadding.size() != 0) buffer.append(" cellpadding=\"" + cellpadding + "\""); if(cellspacing.size() != 0) buffer.append(" cellspacing=\"" + cellspacing + "\""); if(bgcolor.size() != 0) buffer.append(" bgcolor=\"" + bgcolor + "\""); if(border.size() != 0) buffer.append(" border=\"" + border + "\""); if(width.size() != 0) buffer.append(" width=\"" + width + "\""); return(this); }