Please read the following table in HTML format from a webpage and then answer the question in detail according to the table. Each table cell is defined by a <td> and a </td> tag. Each table row starts with a <tr> and ends with a </tr> tag. 'rowspan=m' and 'colspan=n' represents a cell spaning over 'm' rows and 'n' columns.

Webpage title:
2007 Ijok by-election
Table title:
By-election results
Table:
<table id='hittask' contenteditable='False'>
<tr> <th colspan=2 rowspan=1 > Party </th><th colspan=1 rowspan=1 > Candidate </th><th colspan=1 rowspan=1 > Votes </th><th colspan=1 rowspan=1 > % </th><th colspan=1 rowspan=1 > ∆% </th></tr>
<tr> <td colspan=1 rowspan=1 >  </td><td class="highlighted"  colspan=1 rowspan=1 > BN </td><td class="highlighted"  colspan=1 rowspan=1 > K. Parthiban </td><td colspan=1 rowspan=1 > 5,884 </td><td colspan=1 rowspan=1 > 59.33 </td><td colspan=1 rowspan=1 > + 1.98 </td></tr>
<tr> <td colspan=1 rowspan=1 >  </td><td colspan=1 rowspan=1 > PKR </td><td class="highlighted"  colspan=1 rowspan=1 > Abdul Khalid Ibrahim </td><td colspan=1 rowspan=1 > 4,034 </td><td colspan=1 rowspan=1 > 40.67 </td><td colspan=1 rowspan=1 > + 1.46 </td></tr>
<tr> <td colspan=3 rowspan=1 > Total valid votes </td><td colspan=1 rowspan=1 > 9,918 </td><td colspan=1 rowspan=1 > 100.00 </td><td colspan=1 rowspan=1 >  </td></tr>
<tr> <td colspan=3 rowspan=1 > Total rejected ballots </td><td colspan=1 rowspan=1 > 134 </td><td colspan=1 rowspan=1 >  </td><td colspan=1 rowspan=1 >  </td></tr>
<tr> <td colspan=3 rowspan=1 > Unreturned ballots </td><td colspan=1 rowspan=1 >  </td><td colspan=1 rowspan=1 >  </td><td colspan=1 rowspan=1 >  </td></tr>
<tr> <td colspan=3 rowspan=1 > Turnout </td><td colspan=1 rowspan=1 > 10,052 </td><td colspan=1 rowspan=1 > 81.90 </td><td colspan=1 rowspan=1 >  </td></tr>
<tr> <td colspan=3 rowspan=1 > Registered electors </td><td colspan=1 rowspan=1 > 12,272 </td><td colspan=1 rowspan=1 >  </td><td colspan=1 rowspan=1 >  </td></tr>
<tr> <td colspan=3 rowspan=1 > Majority </td><td class="highlighted"  colspan=1 rowspan=1 > 1,850 </td><td colspan=1 rowspan=1 >  </td><td colspan=1 rowspan=1 >  </td></tr>
<tr> <td colspan=1 rowspan=1 >  </td><td colspan=2 rowspan=1 > BN hold </td><td colspan=2 rowspan=1 > Swing </td><td colspan=1 rowspan=1 >  </td></tr>
</table>
Question:
Who were the candidates in the 2007 Ijok by-election, and who won by what margin?
Answer:
The 2007 Ijok by-election was won by the BN candidate K. Parthiban, with a 1,850-vote majority over the opposition candidate, Khalid Ibrahim.