#include #include #include #include using namespace std; int main() { int cols, rows; cout << "Enter number of columns: "; cin >> cols; cout << "Enter number of rows: "; cin >> rows; cin.ignore(); vector headings(cols); vector> data(rows, vector(cols)); cout << "\nEnter headings:\n"; for (int i = 0; i < cols; ++i) { cout << "Heading " << i + 1 << ": "; getline(cin, headings[i]); } for (int i = 0; i < rows; ++i) { cout << "\nEnter data for row " << i + 1 << ":\n"; for (int j = 0; j < cols; ++j) { cout << headings[j] << ": "; getline(cin, data[i][j]); } } ofstream html("table.html"); html << "Table"; html << "

Generated Table

"; html << ""; for (const auto& h : headings) html << ""; html << ""; for (const auto& row : data) { html << ""; for (const auto& cell : row) html << ""; html << ""; } html << "
" << h << "
" << cell << "
"; html.close(); cout << "\nHTML file 'table.html' has been created successfully.\n"; return 0; }