Ben aşagıdaki kodla excelden cektigim verileri tablo oluşturarak içine yükledim fakat düzensiz karışık bir tablo oldu.
Başlıktata belirttigim gibi sutunların genişliklerini en uzun yazıya göre sabitleme işini nasıl yapabilirim ?
Yardımlarınızı bekliyorum.
Daha hoş bir görünüm için bilgisi olan varsa lütfen esirgemeyin bilgilerinizi
Kullandıgım kod : (Excel belgesinin içindekileri okuma kodu !)
Kod:
<?php
require_once 'Excel/reader.php';
$data = new Spreadsheet_Excel_Reader();
$data->setUTFEncoder('iconv');
$data->setOutputEncoding('UTF-8');
$data->read('dosyalar/sonuc.xls');
$satir=$data->sheets[0]['numRows'];
$sutun=$data->sheets[0]['numCols'];
for ($i = 1; $i <= $satir; $i++) {
?>
<table border="1" width="700" align="left">
<tr>
<?php
for ($j = 1; $j <= $sutun; $j++) {
?>
<td><?=$data->sheets[0]['cells'][$i][$j]?></td>
<?php
}
?>
</tr>
<?php
}
?>
</table>
Sayfa Kaynağı Kodu :
Kod:
<br />
<b>Deprecated</b>: Assigning the return value of new by reference is deprecated in <b>/home/u643223325/public_html/NetTakipSistemi/Excel/reader.php</b> on line <b>504</b><br />
<table border="1" width="700" align="left">
<tr>
<td></td>
<td>BİYOLOJİ DENEME -1 SAY-1</td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<table border="1" width="700" align="left">
<tr>
<td></td>
<td>ADI SOYADI</td>
<td>DOGRU</td>
<td>YANLIS</td>
<td>BOS</td>
<td>NET</td>
</tr>
<table border="1" width="700" align="left">
<tr>
<td>1</td>
<td>Ayşegül Bender </td>
<td>25</td>
<td>1</td>
<td>4</td>
<td>24.75</td>
</tr>
<table border="1" width="700" align="left">
<tr>
<td>2</td>
<td>Büşra Şevval Tönbul</td>
<td>25</td>
<td>5</td>
<td>0</td>
<td>23.75</td>
</tr>
<table border="1" width="700" align="left">
<tr>
<td>3</td>
<td>Başak Ertem</td>
<td>24</td>
<td>6</td>
<td>0</td>
<td>22.5</td>
</tr>
<table border="1" width="700" align="left">
<tr>
<td>4</td>
<td>Ayşe Bilge Bayazıt</td>
<td>18</td>
<td>10</td>
<td>2</td>
<td>15.5</td>
</tr>
<table border="1" width="700" align="left">
<tr>
<td>5</td>
<td>Merve Safalı</td>
<td>17</td>
<td>13</td>
<td>0</td>
<td>13.75</td>
</tr>
<table border="1" width="700" align="left">
<tr>
<td>6</td>
<td>Aslınur Tezel</td>
<td>15</td>
<td>11</td>
<td>4</td>
<td>12.25</td>
</tr>
<table border="1" width="700" align="left">
<tr>
<td>7</td>
<td>Dilara Çetintaş</td>
<td>13</td>
<td>11</td>
<td>6</td>
<td>10.25</td>
</tr>
<table border="1" width="700" align="left">
<tr>
<td>8</td>
<td>Berkay Birol</td>
<td>13</td>
<td>17</td>
<td>0</td>
<td>8.75</td>
</tr>
<table border="1" width="700" align="left">
<tr>
<td>9</td>
<td>Hürrem Bozdağ</td>
<td>9</td>
<td>14</td>
<td>7</td>
<td>5.5</td>
</tr>
<table border="1" width="700" align="left">
<tr>
<td>10</td>
<td>Ali Günay</td>
<td>9</td>
<td>16</td>
<td>5</td>
<td>5</td>
</tr>
<table border="1" width="700" align="left">
<tr>
<td>11</td>
<td>Mehmet Sayın</td>
<td>6</td>
<td>10</td>
<td>14</td>
<td>3.5</td>
</tr>
<table border="1" width="700" align="left">
<tr>
<td>12</td>
<td>Emrecan Özek</td>
<td>8</td>
<td>20</td>
<td>2</td>
<td>3</td>
</tr>
<table border="1" width="700" align="left">
<tr>
<td>13</td>
<td>Ramazan Yücel</td>
<td>8</td>
<td>22</td>
<td>0</td>
<td>2.5</td>
</tr>
<table border="1" width="700" align="left">
<tr>
<td>14</td>
<td>Beyza Ayyıldız</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
</tr>
</table>