how to change width of <th> without affecting <td> width - html

I have here 2 photos. 1 is my HTML page and the other one is my print page.
My question is, how am I going to make my print page the same as my html page? As you can see, the print page is less wide than the HTML page.
Also, I want to ask how am I going to make the width of <th> longer without affecting the width of <td>? Is that possible?
Sorry, I don't have that much knowledge in CSS.
Print Page
HTML Page
and here is my code:
<table width="100%" border="1">
<tr>
<th align="left" width="20%">II. Documentation</th>
</tr>
<tr>
<td align="center">Subject Routine</td>
<td width="20%" align="center">Person-in-charge</td>
<td width="15%" align="center">Complied</td>
<td width="10%" align="center">Date</td>
<td width="17%" align="center">Remarks</td>
<td align="center">Signature</td>
</tr>
<tr>
<td>1. Travel Documents</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>2. National License</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>3. NAC Certificates/MARINA COP</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>4. Medical</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>5. POEA / AMOSUP Contracts</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>6. Flag License</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>7. US Visa</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>8. Joining Port Visa</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>9. Other Certificate</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</table>

To get a nice print page width use media queries for example:
#media print {
#page {
margin: 30mm;
size:297mm 210mm;
}
}
Or use diffent stylesheets with different widths in stead of the same 100%
<link href="style.css" rel="stylesheet" type="text/css" media="screen">
<link href="style_print.css" rel="stylesheet" type="text/css" media="print">
And in the style.css add:
table {width:100%}
And in style_print.css add:
table {width:297mm}
Play with the widths untill you are happy in both ;)
Here are some great posts on how to set up CSS for printing:
https://www.smashingmagazine.com/2011/11/how-to-set-up-a-print-style-sheet/
https://www.smashingmagazine.com/2015/01/designing-for-print-with-css/
Just add colspan="6" to your th to set the correct width of your first cell.
<table width="100%" border="1">
<tr>
<th colspan="6" align="left" width="20%">II. Documentation</th>
</tr>
<tr>
<td align="center">Subject Routine</td>
<td width="20%" align="center">Person-in-charge</td>
<td width="15%" align="center">Complied</td>
<td width="10%" align="center">Date</td>
<td width="17%" align="center">Remarks</td>
<td align="center">Signature</td>
</tr>
<tr>
<td>1. Travel Documents</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>2. National License</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>3. NAC Certificates/MARINA COP</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>4. Medical</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>5. POEA / AMOSUP Contracts</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>6. Flag License</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>7. US Visa</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>8. Joining Port Visa</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>9. Other Certificate</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</table>

Tip: When I don't know what my html elements are doing I give them a border so I can see how they are behaving. In this case you don't have the same amount of <th> cells as <td> cells - just add a colspan=6 ( the same number of cells you have ) and your <th> cell will span across the whole table:
<tr>
<th colspan="6" align="left">II. Documentation</th>
</tr>
also you don't require the width unless you are trying to wrap the text ( but it sounds like you aren't. ) ...
oh, nevermind... answered above

Related

Make a table without showing the first cell

I want my table to be like that :
wanted table
Mine, is currently like that :
current table
The difference is that in the wanted table, the first cell (at position 0;0) is removed.
I also want to border to be updated, in order to make it goes through the bottom and the right of the removed cell.
The current result is that :current result
here is my current code :
table, th, td {
border: 0.5px solid black;
border-collapse: collapse;
}
.removeCell {
visibility: hidden;
}
<!DOCTYPE html>
<html>
<head>
<title>Titre du document</title>
<link rel="stylesheet" href="css\desktopStyle.scss">
</head>
<body>
<table>
<tr>
<th class="removeCell">Mois</th>
<th>Data</th>
</tr>
<tr>
<td>Janvier</td>
<td>10.01.2014</td>
</tr>
<tr>
<td>FĂ©vrier</td>
<td>10.01.2014</td>
</tr>
</table>
just remove the border on the first td
td{
border: 1px solid black;
width:40px;
height:10px;
}
table{
border-collapse:collapse;
}
#one{
border:none;
}
<table>
<tr>
<td id='one'></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</table>

Add a two column above div but that column and div should not have gap

In div class background color is black, My question is make a two column in anyway so that the div class of horizontal line should not have gap while making a column.
Suppose i create a two column first and after i make a div class, the output will be shown the gap between column and div , I don't want that gap
<div class="right-div" style="background-color:black">
<table border="2px" style="background-color:red">
<tr>
<th bgcolor="#339A99"><font color="white">S.NO</font></th>
<th bgcolor="#339A99"><font color="white">Course</font></th>
<th bgcolor="#339A99"><font color="white">Duration</font></th>
<th bgcolor="#339A99"><font color="white">Credit Hours</font></th>
<th bgcolor="#339A99"><font color="white">No. Of Learners</font></th>
<th bgcolor="#339A99"><font color="white">Action</font></th>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</table>
</div>

Copy table data from web page to excel sheet

I am using excel macros to copy calculation result data from a online intranet web calculation website.
For that calculation I have to add many data to webpage. I used macros to automate data entry to webpage and finally I can reach to result page. The calculation result is in tabular form. Now I want to copy that result data to excel sheet in tabular form.
I tried web query but that doesn't work as result web page cannot be loaded directly by just address.
Following is the source of html table I want to extract.
<P>
<BR>
<TABLE width="80%">
<TR>
<TD bgcolor="#ffffff" align="center"><b>Life Calculation Result</b>
</TD>
</TR>
</TABLE>
<P>
<TABLE cellspacing="1" cellpadding="0">
<TR align="center">
<TH colspan="6"></TH>
<TH colspan="3" align="center">--- Inboard ---</TH>
<TH></TH>
<TH colspan="3" align="center">--- outboard ---</TH>
<TH></TH>
<TH colspan="3" align="center">--- System ---</TH>
</TR>
<TR align="center">
<TH>No.</TH>
<TH width="10"></TH>
<TH>Displacement</TH>
<TH width="10"></TH>
<TH>Preload</TH>
<TH width="10"></TH>
<TH>Running
<BR>Distance</TH>
<TH width="10"></TH>
<TH>Total
<BR>Number of
<BR>Revolutions</TH>
<TH width="10"></TH>
<TH>Running
<BR>Distance</TH>
<TH width="10"></TH>
<TH>Total
<BR>Number of
<BR>Revolutions</TH>
<TH width="10"></TH>
<TH>Running
<BR>Distance</TH>
<TH width="10"></TH>
<TH>Total
<BR>Number of
<BR>Revolutions</TH>
</TR>
<TR align="center">
<TH></TH>
<TH></TH>
<TH>[mm]</TH>
<TH></TH>
<TH>[N]</TH>
<TH></TH>
<TH>[10<sup><font size="-1">4<font></sup>km]</TH>
<TH></TH>
<TH>[10<sup><font size="-1">6<font></sup>rev.]</TH>
<TH></TH>
<TH>[10<sup><font size="-1">4<font></sup>km]</TH>
<TH></TH>
<TH>[10<sup><font size="-1">6<font></sup>rev.]</TH>
<TH></TH>
<TH>[10<sup><font size="-1">4<font></sup>km]</TH>
<TH></TH>
<TH>[10<sup><font size="-1">6<font></sup>rev.]</TH>
</TR>
<TR align="right">
<TH>(1)</TH>
<TD></TD>
<TD>0.594874</TD>
<TD></TD>
<TD></TD>
<TD></TD>
<TD>3.492e+004</TD>
<TD></TD>
<TD>1.705e+005</TD>
<TD></TD>
<TD>9.796e+004</TD>
<TD></TD>
<TD>4.782e+005</TD>
<TD></TD>
<TD>2.710e+004</TD>
<TD></TD>
<TD>1.323e+005</TD>
</TR>
<TR align="right">
<TH>(2)</TH>
<TD></TD>
<TD>0.604874</TD>
<TD></TD>
<TD></TD>
<TD></TD>
<TD>4.001e+004</TD>
<TD></TD>
<TD>1.953e+005</TD>
<TD></TD>
<TD>1.033e+005</TD>
<TD></TD>
<TD>5.045e+005</TD>
<TD></TD>
<TD>3.042e+004</TD>
<TD></TD>
<TD>1.485e+005</TD>
</TR>
<TR align="right">
<TH>(3)</TH>
<TD></TD>
<TD>0.614874</TD>
<TD></TD>
<TD>0.00</TD>
<TD></TD>
<TD>4.751e+004</TD>
<TD></TD>
<TD>2.320e+005</TD>
<TD></TD>
<TD>1.088e+005</TD>
<TD></TD>
<TD>5.314e+005</TD>
<TD></TD>
<TD>3.495e+004</TD>
<TD></TD>
<TD>1.706e+005</TD>
</TR>
<TR align="right">
<TH>(4)</TH>
<TD></TD>
<TD>0.630867</TD>
<TD></TD>
<TD>1000.00</TD>
<TD></TD>
<TD>3.003e+004</TD>
<TD></TD>
<TD>1.466e+005</TD>
<TD></TD>
<TD>3.941e+004</TD>
<TD></TD>
<TD>1.924e+005</TD>
<TD></TD>
<TD>1.813e+004</TD>
<TD></TD>
<TD>8.854e+004</TD>
</TR>
<TR align="right">
<TH>(5)</TH>
<TD></TD>
<TD>0.639982</TD>
<TD></TD>
<TD>2000.00</TD>
<TD></TD>
<TD>7.425e+003</TD>
<TD></TD>
<TD>3.625e+004</TD>
<TD></TD>
<TD>7.893e+003</TD>
<TD></TD>
<TD>3.853e+004</TD>
<TD></TD>
<TD>4.075e+003</TD>
<TD></TD>
<TD>1.989e+004</TD>
</TR>
<TR align="right">
<TH>(6)</TH>
<TD></TD>
<TD>0.647481</TD>
<TD></TD>
<TD>3000.00</TD>
<TD></TD>
<TD>2.523e+003</TD>
<TD></TD>
<TD>1.232e+004</TD>
<TD></TD>
<TD>2.592e+003</TD>
<TD></TD>
<TD>1.266e+004</TD>
<TD></TD>
<TD>1.362e+003</TD>
<TD></TD>
<TD>6.648e+003</TD>
</TR>
<TR align="right">
<TH>(7)</TH>
<TD></TD>
<TD>0.654070</TD>
<TD></TD>
<TD>4000.00</TD>
<TD></TD>
<TD>1.131e+003</TD>
<TD></TD>
<TD>5.521e+003</TD>
<TD></TD>
<TD>1.148e+003</TD>
<TD></TD>
<TD>5.605e+003</TD>
<TD></TD>
<TD>6.068e+002</TD>
<TD></TD>
<TD>2.962e+003</TD>
</TR>
<TR align="right">
<TH>(8)</TH>
<TD></TD>
<TD>0.660043</TD>
<TD></TD>
<TD>5000.00</TD>
<TD></TD>
<TD>6.007e+002</TD>
<TD></TD>
<TD>2.933e+003</TD>
<TD></TD>
<TD>6.065e+002</TD>
<TD></TD>
<TD>2.961e+003</TD>
<TD></TD>
<TD>3.214e+002</TD>
<TD></TD>
<TD>1.569e+003</TD>
</TR>
<TR align="right">
<TH>(9)</TH>
<TD></TD>
<TD>0.665559</TD>
<TD></TD>
<TD>6000.00</TD>
<TD></TD>
<TD>3.570e+002</TD>
<TD></TD>
<TD>1.743e+003</TD>
<TD></TD>
<TD>3.593e+002</TD>
<TD></TD>
<TD>1.754e+003</TD>
<TD></TD>
<TD>1.907e+002</TD>
<TD></TD>
<TD>9.311e+002</TD>
</TR>
<TR align="right">
<TH>(10)</TH>
<TD></TD>
<TD>0.670717</TD>
<TD></TD>
<TD>7000.00</TD>
<TD></TD>
<TD>2.296e+002</TD>
<TD></TD>
<TD>1.121e+003</TD>
<TD></TD>
<TD>2.307e+002</TD>
<TD></TD>
<TD>1.126e+003</TD>
<TD></TD>
<TD>1.226e+002</TD>
<TD></TD>
<TD>5.983e+002</TD>
</TR>
<TR align="right">
<TH>(11)</TH>
<TD></TD>
<TD>0.675584</TD>
<TD></TD>
<TD>8000.00</TD>
<TD></TD>
<TD>1.566e+002</TD>
<TD></TD>
<TD>7.646e+002</TD>
<TD></TD>
<TD>1.571e+002</TD>
<TD></TD>
<TD>7.671e+002</TD>
<TD></TD>
<TD>8.354e+001</TD>
<TD></TD>
<TD>4.078e+002</TD>
</TR>
<TR align="right">
<TH>(12)</TH>
<TD></TD>
<TD>0.680208</TD>
<TD></TD>
<TD>9000.00</TD>
<TD></TD>
<TD>1.117e+002</TD>
<TD></TD>
<TD>5.455e+002</TD>
<TD></TD>
<TD>1.120e+002</TD>
<TD></TD>
<TD>5.469e+002</TD>
<TD></TD>
<TD>5.958e+001</TD>
<TD></TD>
<TD>2.909e+002</TD>
</TR>
<TR align="right">
<TH>(13)</TH>
<TD></TD>
<TD>0.684622</TD>
<TD></TD>
<TD>10000.00</TD>
<TD></TD>
<TD>8.262e+001</TD>
<TD></TD>
<TD>4.034e+002</TD>
<TD></TD>
<TD>8.278e+001</TD>
<TD></TD>
<TD>4.042e+002</TD>
<TD></TD>
<TD>4.404e+001</TD>
<TD></TD>
<TD>2.150e+002</TD>
</TR>
</TABLE>
Copy your code as it is from the
<table> ... </table>
tag.
Then switch to Excel, pick a cell and press Command-v or use Edit > Paste. Excel knows HTML tables and will format the table just right.
Without an URL it is guesswork.
You can get all the TABLE tag elements with, say using internet explorer browser to scrape,
IE.document.getElementsByTagName("TABLE")
You then select a particular table by index; Let's say index 0 i.e. the first table in the collection.
IE.document.getElementsByTagName("TABLE")(0)
If you have added references (VBE > Tools > References > Microsoft Internet Controls and HTML Object Library) you can put this table into an HTMLTable object variable:
Dim nTable As HTMLTable
Set nTable = IE.document.getElementByTagName("TABLE")(0)
You can then select tr tags in the table, to get the table rows
nTable.getElementsByTagName("tr")
and within each row you can loop its cells either via td tags or along the row length:
nTable.getElementsByTagName("tr")(i).getElementsByTagName("td")
Where i is the current index of the loop over the rows collections from the step before.
When looping the table cells, which are the inner loop items obtained by the td tags, you can then access their .innerText property to get the values.
Examples of what are contained in the rows of the outer loop (tr tags):
Examples of what is within individual rows (td tags) in the table cells:
So, when you outer loop the rows, and then inner loop the cells, you will get the values shown in the image directly above.
Example of where this is done in full, bearing in mind according to each webpage you have to tweak the loop somewhat: https://stackoverflow.com/a/50888649/6241235

Class Schedule difficulty

I am having a bit of trouble making a class schedule in HTML coding, I got to have the times like: 1:00, 1:30 etc. on the left and in the main body having rowspans for the different classes on the different days.
An example would be I have the same classes on monday and wednesday but no classes on tuesday thursday friday saturday or sunday.
In my efforts so far I am able to span the rows but unfortunately get extra columns at the end.
<table border="1">
<tr>
<th>TIME</th>
<th>Monday</th>
<th>Tuesday</th>
<th>Wednesday</th>
<th>Thursday</th>
<th>Friday</th>
<th>Saturday</th>
<th>Sunday</th>
</tr>
<tr>
<th>8:00AM</th>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<th>8:30AM</th>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<th>9:00AM</th>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<th>9:30AM</th>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<th>10:00AM</th>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<th>10:30</th>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<th>11:00AM</th>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<th>11:30AM</th>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<th>12:00PM</th>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<th>12:30PM</th>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<th>1:00PM</th>
<td rowspan="6">FA 3550 - 001</td>
<td></td>
<td rowspan="6">FA 3550 - 001</td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<th>1:30PM</th>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<th>2:00PM</th>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<th>2:30PM</th>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<th>3:00PM</th>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<th>4:00PM</th>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<th>5:00PM</th>
<td rowspan="3">class</td>
<td></td>
<td rowspan ="3">class</td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<th>5:30PM</th>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<th>6:00PM</th>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<th>6:30PM</th>
<td></td>
<td></td>
<td rowspan="5">class</td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<th>7:00PM</th>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<th>7:30PM</th>
<td rowspan="6">class</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<th>8:00PM</th>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<th>8:30PM</th>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<th>9:00PM</th>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<th>9:30PM</th>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</table>
Here is an example of your problem.. notice how in one of the rows, I filled in the letter "d" for each cell for that row:
http://jsfiddle.net/57FLP/
<tr>
<th>1:00PM</th>
<td rowspan="6">FA 3550 - 001</td>
<td></td>
<td rowspan="6">FA 3550 - 001</td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<th>1:30PM</th>
<td>d</td>
<td>d</td>
<td>d</td>
<td>d</td>
<td>d</td>
<td>d</td>
<td>d</td>
</tr>
Looking at the html code, the letter 'd' for each <td></td>, which happens to be 7 times; your table also shows it 7 times; however because you are doing a rowspan, from one of your rows somewhere in the middle, you're cutting into the rows below it. Don't think of your row span as a knife cutting through butter, think of it as your hand chopping down on a bunch of apples (not cutting through them, but moving them, the apple will then fill up the sides as it has no where else to go); this is analogous as to what is happening with you table.
Just think about what happens if all your <td></td> are filled with data, and you just happen to convert one as a rowspan, where would all that data go? You don't want to lose any of it.
What you need to do, is for every change you make, you have to cut off the remaining unused tds from your table.

How to structure html table

I'm trying to make a table that looks like the picture but i can't figure it out... This must be so easy question for you but I'm having trouble making this one work... can anyone help me? Please.
here is my current code for it:
<table width="100%" border="1">
<tr>
<th>Name of Candidates</th>
<th>Educational Attainment</th>
<th>Exprerience</th>
<th>In-Service Trainings & Seminars Attended</th>
<th>Eligibility</th>
<th>Other Qualifications</th>
<th>Interview</th>
<th>Total</th>
<th>Remarks</th>
</tr>
</table>
Use a combination of rowspan and colspan
example
The first row will contain all the cells that takes 2 rows and 1 cell that spreads on 4 columns (gray background on the example). The second row will contain the 4 cells under the cell that spreads on 4 cells.
<table>
<tr>
<td rowspan="2"></td>
<td colspan="4"></td>
<td rowspan="2"></td>
<td rowspan="2"></td>
<td rowspan="2"></td>
<td rowspan="2"></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</table>
<table>
<tr>
<td></td>
<td></td>
<td colspan="7" rowspan="2"></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</table>
Its good helper for dificult table generator.
http://html-tables.com/
Use colspan to increase width of a cell:
colspan="4"
Documentation colspan
Use rowspan to increase height of a cell:
rowspan="2"
Documentation rowspan
Here you go, use colspan to span multiple columns.
<table widtd="100%" border="1">
<tr>
<td>Name of Candidates</td>
<td colspan="4">Educational Attainment</td>
<td>Otder Qualifications</td>
<td>Interview</td>
<td>Total</td>
<td>Remarks</td>
</tr>
<tr>
<td>Name of Candidates</td>
<td>Educational Attainment</td>
<td>Exprerience</td>
<td>In-Service Trainings & Seminars Attended</td>
<td>Eligibility</td>
<td>Otder Qualifications</td>
<td>Interview</td>
<td>Total</td>
<td>Remarks</td>
</tr>
</table>
Similarly you could use rowspan for span multiple rows.