Question: I have tried this code 

```
if (ds.Tables[0].Rows[0]["NRType"].ToString() == "0002")
{
    ReportObj.ReportFileName = "report1.rpt";
}
else if (ds.Tables[0].Rows[0]["NRType"].ToString() == "0011")
{
    ReportObj.ReportFileName = "report2.rpt";
}
else if (ds.Tables[0].Rows[0]["NRType"].ToString() == "0007")
{
    ReportObj.ReportFileName = "report3.rpt";
}

```

This is the function where I get the data and I call a stored procedure 

```
public DataSet getreport()
{
    DataSet ds;
    try
    {
        SqlParameter[] Params = 
        { 
            new SqlParameter("@FormID",SqlDbType.VarChar),
        };
        if (FormID != null)
        {
            Params[0].Value = FormID;
        }
        else
        {
            Params[0].Value = DBNull.Value;
        }
        ds = GetDataSet("SP_GetCertReportData", Params);
        return ds;
    }
    catch (Exception ex)
    {
        throw new Exception(ex.Message);
    }
}

```

and there is error occurred 

> 
> "There is no row at position 0"
> 
> 
> 

Any solutions?

Answer: 
Try using `word-wrap: break-word;` in your style. It makes the string goes down if ever the max widht is reached.

```
<table class="table">
                        <thead>
                        <tr>
                         <th>No</th>
                         <th>Question</th>
                         <th>A</th>
                         <th>B</th>
                         <th>C</th>
                         <th>D</th>
                         <th>Answer</th>
                         <th>Button</th>
                        </tr>
                        </thead>
                        <tbody>
                        <?php 
                        include "conection.php";
                        $no = 1;
                        $query = mysql_query("SELECT * FROM grammar");
                        if ($query) {
                        while ($row = mysql_fetch_array($query)) {
                            echo "
                                <tr>
                                    <td>".$no."</td>
                                    <td style='width:40%; word-wrap: break-word;'>".$row['question']."</td>
                                    <td>".$row['a']."</td>
                                    <td>".$row['b']."</td>
                                    <td>".$row['c']."</td>
                                    <td>".$row['d']."</td>
                                    <td>".$row['answer']."</td>
                                    <td>
                                        <a href=\"update.php?id=\">Edit</a> |
                                        <a href=\"delete_grammar.php?id=\">delete</a>
                                    </td>
                                </tr>";
                            $no++;
                            }
                        }
                        ?>
                        </tbody>
                    </table>

```

Here is the sample [JSFiddle](http://jsfiddle.net/uAKNx/4814/)
The answer from Lee will get you the result you need but do note that all lengths of words can break that way if they reach a set width which may reduce readability. The screen shot you took puts that column as a question field. That question looks like a potentially unrealistic test of content but it is good to account for oddities. Email address or URL columns can have this issue of overflow problems and readability may not be as much of a need for a user. Most users probably want to be able to quickly read the question and broken words may make that difficult.

If possible when readability is still needed, you could wrap the content of that cell inside of a div that has overflow-x:auto or hidden and width 100% depending on desired result. 

This will either cut off such possible rare instances or at least let the user scroll through the text.

The container td would need a specific width in pixels or other unit that isn't variable in order for tables to be handled correctly across all browsers. If you want you can also instead add a pixel width on the div rather than 100% width.